tags:

views:

943

answers:

3

I wrote a simple batch file as a powershell script, getting errors when they run.

its in a scripts directory in my path.

Cannot be loaded because the execution of scripts is disabled on this system. 
please see "get-help about-signing".

I looked in the help, but its less than helpful.

@Matt HAmilton's answer FTW

A: 

try posting the errors, and hey, why not post the script as well.

Leon Bambrick
+4  A: 

Could be PowerShell's default security level, which (IIRC) will only run signed scripts.

Try typing this:

set-executionpolicy remotesigned

That will tell PowerShell to allow local (that is, on a local drive) unsigned scripts to run.

Then try executing your script again.

Matt Hamilton
+1  A: 

also it's worth knowing that you include .\ in front of the script name, for example

.\scriptname.ps1

Leon Bambrick