Skip to content

Instantly share code, notes, and snippets.

@hapylestat
Created August 14, 2013 11:37
Show Gist options
  • Save hapylestat/6230267 to your computer and use it in GitHub Desktop.
Save hapylestat/6230267 to your computer and use it in GitHub Desktop.
Variation of executing powershell scripts
1. Via stdin
type "%~dp0<my_script>.ps1" | powershell.exe -command -
2. Default way
powershell.exe -File "%~dp0<my_script>.ps1"
3. Avoid system security setting
powershell.exe -ExecutionPolicy Unrestricted -File "%~dp0<my_script>.ps1"
3. ps script with WPF forms
powershell.exe -ExecutionPolicy Unrestricted -File "%~dp0<my_script>.ps1" -sta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment