Skip to content

Instantly share code, notes, and snippets.

@lucasancelmodias
lucasancelmodias / script.ps1
Created July 7, 2022 01:27
Powershell script to launch Plex if it's not running
Do{
If (-NOT (Get-Process -ProcessName "Plex Media Server" -ErrorAction SilentlyContinue)) {
Write-Host "Launch application"
$application = "C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe"
Start-Process -FilePath $application
}
Else{
Write-Host "Process is running"
}
Start-Sleep -Seconds 5