Следующий скрипт будет запускаться, если я запустил его свернутым, но не, если я запустил его скрытым. Что я делаю не так?
#The intention of this script is to function as a keepalive.
#The command used to run it in a hidden state is
#powershell.exe -windowstyle hidden c:\psscript\keepalive.ps1
# How long to run script(1)=infinite
while (1) {
$wsh = New-Object -ComObject WScript.Shell
# Enter the keystrokes to be sent between the {}
$wsh.SendKeys('{SCROLLLOCK}')
# Time between keystrokes
Start-Sleep -seconds 600
}