@echo off
set SCRIPTNAME="sample.ps1"
start /b conhost.exe powershell -ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -File "%~dp0%SCRIPTNAME%"
2.2 引数なし × 表示(Normal)
@echo off
set SCRIPTNAME="sample.ps1"
start conhost.exe powershell -ExecutionPolicy Bypass -NoProfile -WindowStyle Normal -File "%~dp0%SCRIPTNAME%"
2.3 引数あり × 非表示(Hidden)
@echo off
set SCRIPTNAME="sample.ps1"
set ARG1=%1
set ARG2=%2
start /b conhost.exe powershell -ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -File "%~dp0%SCRIPTNAME%" -Arg1 "%ARG1%" -Arg2 "%ARG2%"
2.4 引数あり × 表示(Normal)
@echo off
set SCRIPTNAME="sample.ps1"
set ARG1=%1
set ARG2=%2
start conhost.exe powershell -ExecutionPolicy Bypass -NoProfile -WindowStyle Normal -File "%~dp0%SCRIPTNAME%" -Arg1 "%ARG1%" -Arg2 "%ARG2%"