Last active
September 29, 2023 05:41
-
-
Save hunandy14/6a290cc77609c13a899b9a6e0801d008 to your computer and use it in GitHub Desktop.
PowerShell 與 Bat 的混合代碼
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
@(set "0=%~f0"^)#) & set "1=%*" & setlocal enabledelayedexpansion & powershell -nop -c "iex([io.file]::ReadAllText($env:0));$Host.SetShouldExit($LastExitCode);Exit $LastExitCode" & exit /b !errorlevel! | |
Write-Host "by PSVersion::" $PSVersionTable.PSVersion | |
Write-Host "Command is '$env:0 $env:1'" | |
Exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment