for loop and start-job from cmd.exe
hello, i have simple script developed debug purposes: $serverlist = @( "sca-c1cor01", "scb-c1cor01" ) ($i=0; $i -lt $serverlist.length; $i++) { start-job -scriptblock {$x=0} } i have saved script off file called test.ps1. when run ./test.ps1 within interactive powershell runs fine. i trying to call script dos window, sql server agent command job, or start->run line. here syntax using: cmd.exe /c powershell -nologo -noninteractive "c:\scripts\powershell\test.ps1" when run way (from dos window), diaglog box pops says: powershell has stopped working problem caused program stop working correctly. windows close program , notify if solution available. i close , open eventvwr.msc. 2 pieces of info. 1 application , services log (windows powershell): engine state changed available stopped. details: newenginestate=stopped previousenginestate...