Wednesday, February 1, 2012

How to run scripts from within Powershell

As taken form here.

To summarize, here’s how you run from scripts from within Windows PowerShell:

  • Make sure you’ve changed your execution policy. By default, PowerShell won’t run scripts at all, no matter how you specify the path.

  • To run a script, specify the entire file path, or either: 1) use the .\ notation to run a script in the current directory or 2) put the folder where the script resides in your Windows path.

  • If your file path includes blank spaces, enclose the path in double quote marks and preface the path with an ampersand.

No comments: