Skip to content

Instantly share code, notes, and snippets.

@hidari
Created July 9, 2013 23:40
Show Gist options
  • Save hidari/5962290 to your computer and use it in GitHub Desktop.
Save hidari/5962290 to your computer and use it in GitHub Desktop.
batからps1ファイルを実行するときのあれこれ ref: http://qiita.com/HiDARi/items/1d2595ff142883c3bac1
powershell Set-ExecutionPolicy RemoteSigned
powershell .\main.ps1
powershell Set-ExecutionPolicy Restricted
@jmiller76
Copy link

you may want to look at something like this:
Powershell -file %~dpn0.ps1 %* -noprofile -executionpolicy unrestricted

It will run a .PS1 file that has the same file name (without extension) and path. It will avoid the Execution policy without requiring admin rights. Also it will pass along command line arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment