If you ever run in to the following error when you edit and save CreateSrsMedia.ps1 and then try to run the powershell script to get an error ” CreateSrsMedia.ps1 cannot be loaded because running scripts is disabled on this system. “
PS C:\temp> .\CreateSrsMedia.ps1
.\CreateSrsMedia.ps1 : File C:\temp\CreateSrsMedia.ps1 cannot be loaded because running scripts is disabled on this
system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
.\CreateSrsMedia.ps1
-----------
CategoryInfo : SecurityError: (:) [], PSSecurityException
FullyQualifiedErrorId : UnauthorizedAccess
To resolve this error we need to set the scope of the exection policy to ‘bypass’
PS C:\temp> Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): a
PS C:\temp>