You may be unable to run a PowerShell script if execution of scripts is disabled. You will also get this error:
PowerShell Script.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details.
You are unable to execute your PowerShell script because, by default loading unsigned PowerShell scripts is disabled. To fix this, run this command in PowerShell:
Once you are able to run the PowerShell script, don’t forget to return the security setting back to the way it was afterwards, using the following command: