powershell - Why does the script output itself to the console? -
my script outputs console before executing script. code:
for ($i=1; $i -le 1000; $i++) { write-host "sending request #$i" $request = invoke-webrequest "http://localhost/test" $random = get-random -minimum 1 -maximum 5 start-sleep -seconds $random }
what doing wrong , how fix it?
this happens when use powershell ise , run script without saving it.
essentially copies whole script console , executes there.
once save file, switch calling file , won't display whole script.
you can see first hand if execution policy set not execute scripts, because you'll able run script before saving not after (until change execution policy).
Comments
Post a Comment