Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <# : Start of the batch script, perceived as a comment in PowerShell
- @echo off
- DEL %temp%\input.txt
- set argCount=0
- :: For loop that puts every input args in a temp text file
- for %%x in (%*) do (
- set /A argCount+=1
- echo %%~x >> %temp%\input.txt
- )
- :: Opens itself as PowerShell
- pwsh.exe -noexit -c "iex (${%~f0} | out-string)"
- #>
- [array]$Arguments = Get-Content "$env:TMP\input.txt"
- $Arguments # And there you go, some fancy args ready to use in an array! :)
- pause <# the only downside with this is that the VSCode extension bugs out and thinks there's an error at the end#>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement