Introduction
If you are getting this error which says .ps1 file cannot be run because the file is not digitally signed. You cannot run this script on the current system

Cause
By default, the command prompts are set to run only the scripts that are digitally signed. Usually, in prod servers this could be the ideal case.
Fix
But in some cases, you may not need digitally signed scripts to execute the standard admin jobs, such as getting the system performance, or generating the M365 services report or running some standard migrations from on-prem to cloud. In this case, you can set the execution policy for current user to unrestricted.
Set-ExecutionPolicy Unrestricted -Scope CurrentUser

After running this command, you should be able to run the unsigned PowerShell scripts for this user.

Join the conversation! Your thoughts help the community grow.