Reputation: 1457
I want to invoke test1.ps1 from test2.ps1. And I want to pass arguments from test2.ps1 to test1.ps1 while invoking.
Upvotes: 0
Views: 2178
Reputation: 200273
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
Upvotes: 4