バッチファイルから PowerShell を呼び出す方法(終了コード返却版)
ツイーヨ済みですが忘備録として。
@echo off
@powershell -NoProfile -ExecutionPolicy Unrestricted "$s=[scriptblock]::create((gc \"%~f0\"|?{$_.readcount -gt 3})-join\"`n\");&$s" %*
exit /b %errorlevel%
# PowerShellのコード
参考
バッチファイルから PowerShell を呼び出す方法https://qiita.com/cd01/items/82829ba0ec0f59e1b04d





0 件のコメント: