Execute PowerShell Script

Possibly save 1 hour of your time:

  1. Use ./ (dot and slash and PowerShellScriptName) to run the command in the current path folder. You don’t need to enter .ps1

Often times you will type cd to change directory to the folder where the PowerShell script exists. Then you type the script name and it gives you error that the command is not recognized.

Incorrect
PS C:\Scripts> HelloWorld

Correct
PS C:\Scripts> ./HelloWorld

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