Advertisement
cannot be loaded because running scripts is disabled on this system.
When we are trying to run the script from Power Shell ISE , we got this error message as per the below screen shot
File C:\Users\Raavi\Documents\CreateFolders.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.
+
CategoryInfo : SecurityError:
(:) [], ParentContainsErrorRecordException
+
FullyQualifiedErrorId : UnauthorizedAccess
Solution : This issue will happened when running script is disabled in our machine , to run the script
Opened PowerShell ISE and ran this command
Get-ExecutionPolicy
we can see the status as per the below
Run this command this will allow us to run the scripts
set-ExecutionPolicy RemoteSigned -Scope CurrentUser
After clicking on Yes , we can again check the status Get-ExecutionPolicy
Now we are getting status as RemoteSigned , able to run scripts successfully.
Hope this will helps!!
0 comments:
Post a Comment