Prosto:
1 |
$c=Get-Process -name notepad |
1 |
If($c -eq $null) { notepad.exe } |
A jeżeli chcesz kogoś zdenerwować włączając mu notatnik jeśli jeszcze nie działa, to:
1 |
while ($true) |
1 |
{ |
1 |
$c=Get-Process -name notepad |
1 |
If($c -eq $null) |
1 |
{ |
1 |
notepad.exe |
1 |
} |
1 |
start-sleep -s 5 |
1 |
} |