$count = 0 while (1 -ne 0) { $count = $count + 1 echo("Hello World") if ($count % 2) { echo("") Start-Sleep -m 1000 } if ($count -gt 10) { break } }
I did learn that running a powershell script file is disabled by default. Typing the command
Get-ExecutionPolicywill return what the policy is currently set at.
Set-ExecutionPolicy remotesignedwill allow you to run PowerShell script files that you create and will not run other script files, unless the other script has been signed by a trusted publisher. There are other policy levels that this can be set to, but this is all I needed for now.
It will be interesting when I come up with something that I am currently doing that PowerShell can make easier for me.
No comments:
Post a Comment