none
Error: "File cannot be loaded because the execution of scripts is disabled on this system"

    Question

  • Hello,

    I'm executing powershell scripts from command prompt. I've changed my execution policy to Unrestricted. Also, Get-ExecutionPolicy is showing 'Unrestricted'. When i execute following error

    "File cannot be loaded because the execution of scripts is disabled on this system"

    Reason ?


    Sohaib Khan
    Wednesday, August 10, 2011 12:23 PM

Answers

All replies

  • Is it a 64 bit machine? If so, open the x86 instance of PowerShell and check (set) the execution policy.
    Shay Levy [MVP]
    PowerShay.com
    PowerShell Toolbar
    • Marked as answer by Sohaib Khan Wednesday, August 10, 2011 12:52 PM
    Wednesday, August 10, 2011 12:33 PM
    Moderator
  • Yes, it's a x64 machine and i'm using SharePoint 2010 Management Shell.

    Where can i find x86 instance ?


    Sohaib Khan
    • Proposed as answer by testanicet Wednesday, June 05, 2013 11:54 AM
    • Unproposed as answer by testanicet Wednesday, June 05, 2013 11:54 AM
    Wednesday, August 10, 2011 12:39 PM
  • Yes, it's a x64 machine and i'm using SharePoint 2010 Management Shell.

    Where can i find x86 instance ?


    Sohaib Khan
    %windir%\SysWOW64\WindowsPowerShell\v1.0
    • Proposed as answer by Riyas Hussain Wednesday, June 05, 2013 8:30 AM
    Wednesday, August 10, 2011 12:43 PM
  • Please try this

    Set-ExecutionPolicy Unrestricted

    Wednesday, February 01, 2012 11:27 PM
  • Try with Force switch

    Set-ExecutionPolicy Unrestricted -Force


    Regards Ram
    • Proposed as answer by tarah4 Thursday, April 03, 2014 4:39 PM
    Thursday, February 02, 2012 9:27 AM
  • If I use -Force I get...

    A parameter cannot be found that matches the parameter name 'Force'

    Monday, April 30, 2012 11:07 AM
  • Had the same issue, and this has fixed it for me!

    Seems a bit odd that the system would have different Execution Policies for 32 and 64-bit though doesn't it?

    Thanks for the help!

    • Proposed as answer by Roel Janssens Tuesday, April 15, 2014 7:55 AM
    Friday, June 15, 2012 9:52 AM
  • Running powershell as Administrator and executing "set-ExecutionPolicy Unrestricted" worked for me.
    Thursday, February 20, 2014 6:46 PM