Powershell-“File cannot be loaded”

Recently,i have upgraded my office laptop to Windows 8.After my powershell ISE stopped responding in fact working on Windows 7.

After few days i was forced to work on one powershell script.So i opened Powershell ISE in Administrator mode and ran an existing script.

Suddenly, the output pane throws some weird messages in red saying

File XXXX cannot be loaded because running scripts is disabled on this system. For more
information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess

Don’t panic,there is nothing wrong here

Mr.Q – The first thing to check for is “are you running your powershell ISE in Administrator Mode”

Mr.A – Yes

OK

Mr.Q -Now run this command in your output pane

Get-ExecutionPolicy

If the response is ‘Restricted’

The issue is clear…..you have to change so called ExecutionPolicy

The options to change are

Set-ExecutionPolicy RemoteSigned

any scripts that you write yourself, but to run scripts downloaded from the Internet only if those scripts have been signed by a trusted publisher.

Alternatively, you can set the execution policy to

AllSigned (all scripts, including those you write yourself, must be signed by a trusted publisher)

or Unrestricted (all scripts will run, regardless of where they come from and whether or not they’ve been signed).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s