rDale
Enthusiast
Enthusiast

passing arguments on the command line

stupid question,

$source = $args[0]

$target = $args[1]

script.ps1 1 2

No matter what i do all i get is one argument i need 1 to be source and 2 to be target

0 Kudos
1 Reply
harkamal
Expert
Expert

Start of Script

-


Param(

$source,

$target

)

....

End of Script

Call the script as ./myScript.ps1 sourceIs1 targetIs2

0 Kudos