Tuesday, 18 November 2014

Error : file .ps1 cannot be loaded because the execution of scripts is disabled on this system

Error : file .ps1 cannot be loaded because the execution of scripts is disabled on this system

During execution of  powershell script you may face the error "File .......ps1 cannot be loaded because the execution of scripts is disabled on this system."

This is because the script execution is by default disable. You will have to enable it to execute the powershell scripts.

To enable the script execution run following commandlet on powershell.

Set-ExecutionPolicy Unrestricted

OR

Set-ExecutionPolicy Unrestricted -Force

For more information please refer the here Running Windows PowerShell Scripts.
  • 0Blogger Comment
  • Facebook Comment