Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从 test2.ps1 调用 test1.ps1。我想在调用时将参数从 test2.ps1 传递给 test1.ps1。
PS C:\> gc .\test2.ps1 .\test1.ps1 'foo' Write-Host 'bar' PS C:\> gc .\test1.ps1 $a = $ARGS[0] -split '' [array]::Reverse($a) Write-Host ($a -join '') PS C:\> .\test2.ps1 oof bar