Tuesday, April 24, 2012

Error message: cannot be loaded because the execution of scripts is disabled on this system

Trying to run Powershell script? Just set the following:

PS > Set-ExecutionPolicy RemoteSigned

Alternatively, you can set the execution policy to AllSigned (all scripts, including those you write yourself, must be signed by a trusted publisher) or Unrestricted (all scripts will run, regardless of where they come from and whether or not they’ve been signed). 

Then test it again:

param($Argument1,$Argument2)

"Argument1 is: $Argument1"
"Argument2 is: $Argument2"

No comments:

Post a Comment