I've tried the following:
Start-Process powershell -ArgumentList "C:\Program Files\Prometheus.io\prometheus.exe" -WindowStyle hidden
Invoke-Command -ComputerName . -AsJob -ScriptBlock {
'C:\Program Files\Prometheus.io\prometheus.exe'
}
Start-Job -Name "prometheus" -ScriptBlock {Get-Process prometheus.io}
Start-Job {& .\prometheus.exe}
Sometimes it starts but terminates immediately after starting. If I start it manually it works correctly.
How can I keep my process alive in background?
EDIT :
It doesn't worked because i wasn't in the directory of my process that need a file which pathfile is not set.