i have the following code
Start-Process -windowstyle minimized "C:/xampp/xampp-control.exe"
There is a way to know if process is already running?
One way to do this is to get the process ID of the process (use the -PassThru parameter of Start-Process) and then you can see if the process exists by ID. Example:
-PassThru
Start-Process
$processId = (Start-Process notepad -PassThru).Id if ( Get-Process -Id $processId -ErrorAction SilentlyContinue ) { "Process is running" }
1.4m articles
1.4m replys
5 comments
57.0k users