Hello Stack Community :)
I have a simple goal. I\'d like to start some PowerShell Script from an another Powershell Script, but there are 3 conditions:
What you can do it the following to pass a parameter to a ps1 script.
The first script can be a origin.ps1 where we write:
& C:\scripts\dest.ps1 Pa$$w0rd parameter_a parameter_n
Th destination script dest.ps1 can have the following code to capture the variables
$var0 = $args[0]
$var1 = $args[1]
$var2 = $args[2]
Write-Host "my args",$var0,",",$var1,",",$var2
And the result will be
my args Pa$$w0rd, parameter_a, parameter_n