Search found 1 match
- 17 Mar 2022 10:20
- Forum: DOS Batch Forum
- Topic: Powershell2/bat hybrid?
- Replies: 26
- Views: 84543
Re: Powershell2/bat hybrid?
Using `Invoke-Command` should avoid many problems from `iex`, if want to make args[0] point to the script path, change %* to "'%~f0'" %* <# : batch portion @powershell -noprofile "& {icm -ScriptBlock ([Scriptblock]::Create((cat -Raw '%~f0'))) -NoNewScope -ArgumentList $args}" %* @exit /b %errorlevel...