Created
August 12, 2016 08:41
-
-
Save danmaq/80d396eebc0ae83a1e1e0cd74ef4cf88 to your computer and use it in GitHub Desktop.
PowerShell のスクリプト実行が許可されていない環境でも ps1 スクリプトを動かす方法 (バッチファイルにスクリプトを埋め込むこともできます!)
This file contains 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 -NoProfile -ExecutionPolicy Unrestricted "$s=[scriptblock]::create((gc \"%~f0\"|?{$_.readcount -gt 1})-join\"`n\");&$s" %*&goto:eof | |
<# | |
これで下記の hoge.ps1 が起動します。 | |
または下記を消して、その行から PowerShell スクリプトをべた書きでもおk | |
#> | |
. .\hoge.ps1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment