I have written a powershell script, but when i try to run it, i get an error saying .ps1 file cannot be loaded and It is not digitally signed.
Powershell.exe -ExecutionPolicy Unrestricted -File script.ps1
Please help me out to solve this issue.
I have written a powershell script, but when i try to run it, i get an error saying .ps1 file cannot be loaded and It is not digitally signed.
Powershell.exe -ExecutionPolicy Unrestricted -File script.ps1
Please help me out to solve this issue.
try using:
powershell.exe -ExecutionPolicy Bypass -File script.ps1
Unrestricted
will prompt you with a warning for downloaded files. Try using the executionpolicy Bypass
. As an alternative, you could go into the properties of the file and unblock the file.
-- Unrestricted: Loads all configuration files and runs all scripts. *If you run an unsigned script that was downloaded from the Internet, you are prompted for permission before it runs.
-- Bypass: Nothing is blocked and there are no warnings or prompts.
Source: Set-ExecutionPolicy