Skip to end of banner
Go to start of banner

How to Run PowerShell Scripts

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

Microsoft recommends and endorses the use of PowerShell scripts over .dat files.

  • The PowerShell ISE editor is part of standard Window’s installs on most desktop and servers.

  • See also pages on Microsoft PowerShell

Run from the PowerShell Editor (PowerShell ISE)

  1. In Windows File Explorer right click on the powershell script file (.ps1) > click Edit

  2. PowerShell ISE should run. The PowerShell ISE can both edit and run Powershell scripts.

  3. Edit the script as appropriate.

  4. Click the green Run button in the Toolbar or F5.

Run PowerShell from the Command Line or .bat script

Simple version.

powershell -file "<script name.ps1>"

Set ExecutionPolicy

If PowerShell’s execution policy is not appropriately set at the system level it can be changed in the run command.

PowerShell -NoProfile -ExecutionPolicy Bypass -file "<script name.ps1>"

About PowerShell Execution Policies

  • No labels