Exchangemaster GmbH company logo

Exchangemaster GmbH - A Swiss IT Consultancy
Services
References
Partners
Contact
Getting Started
FAQs
Presentations
Articles
Community
Search
Popular
Tell-a-Friend
Follow Me

Follow exchangemaster on Twitter

Who's Online
We have 103 guests online
Syndicate
FAQ 000034 - How do I run a PowerShell script? PDF Print E-mail
User Rating: / 2
PoorBest 
Written by Dejan Foro   
Nov 04, 2007 at 01:38 PM

This article applies to:
PowerShell 1.0

PROBLEM:
When you try to run a PowerShell script from the Run dialog box or by double clicking it, the script does not execute, but opens in Notepad.

SOLUTION:
You have to use a command line to start PowerShell and pass the full path to the script as a parameter.

EXAMPLE:
So for example if I want to run a script named MyScript.ps1 from directory C:\scripts you would have to type the following:

PowerShell.exe c:\scripts\MyScript.ps1

Last Updated ( Apr 20, 2014 at 03:05 PM )
<Previous   Next>