更新时间:2023-10-27 16:40:40
这其中只有通过正确的行PowerShell的:
This one only passes the right lines to PowerShell:
dosps2.cmd
:
@findstr/v "^@f.*&" "%~f0"|powershell -&goto:eof
Write-Output "Hello World"
Write-Output "Hello some@com & again"
前pression 排除开始 @行˚F
键,包括&放大器;
并通过其他一切PowerShell的
The regular expression excludes the lines starting with @f
and including an &
and passes everything else to PowerShell.
C:\tmp>dosps2
Hello World
Hello some@com & again