PowerShell: Enable Script Support

Home -> Windows

5463 views

From the computer of: shamanstears (707 recipes)
Created: Jul 12, 2007     Updated: Jul 13, 2007


Add a comment

Add to:
Add to stumbleuponAdd to del.icio.usDigg itAdd to FURL

By default, PowerShell has scripting support disabled. If you try and run a PowerShell script, you will be greeted with an error stating that the execution of scripts is disabled on your system. To enable scripting support so that your scripts will run, read on:

1. Open PowerShell (if you are running PowerShell on Windows Vista, right-click your PowerShell icon and select Run as administrator. If you don't do this, you will not be able to enable script support).

2. Check the current script execution policy by using the Get-ExecutionPolicy cmdlet. To do this, input Get-ExecutionPolicy and press Enter on your keyboard. PowerShell will return a value of Restricted.



3. To change the script execution policy, use the Set-ExecutionPolicy cmdlet. Input Set-ExecutionPolicy unrestricted and press Enter on your keyboard.

4. To ensure that the script execution policy has been changed, use the Get-ExecutionPolicy cmdlet again. PowerShell should return a value of Unrestricted.



You can now run your PowerShell scripts.

Subscribe to the Tech-Recipes Newsletter

You can get tips like this delivered in your email every week!

Enter your Email

We will never, ever sell your email address or spam you.





Related recipes:

  PowerShell: Get a Cmdlet or Script's Execution Time
  PowerShell 1.0: Getting Help with Get-Help
  Windows Server 2008: Install Windows PowerShell
  PowerShell: Quick Way to Check for a File Type on a Drive or Directory
  XP Pro: Howto Enable/Disable the Security Tab via a JScript
  XP: Get Your Help and Support Working Registry Hack
  XP: Disable Script Debugger in IE
  Windows XP: AMD Ahtlon 64 and Cool n Quiet
  How to Remotely Enable Remote Desktop
  XP: Disable Task Manager (Script Included)

 

Sponsored links

 

Login

Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.