Created
July 9, 2013 23:40
-
-
Save hidari/5962290 to your computer and use it in GitHub Desktop.
batからps1ファイルを実行するときのあれこれ ref: http://qiita.com/HiDARi/items/1d2595ff142883c3bac1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
powershell Set-ExecutionPolicy RemoteSigned | |
powershell .\main.ps1 | |
powershell Set-ExecutionPolicy Restricted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.