pwsh string cmd

发布时间 2023-06-22 08:25:26作者: fndefbwefsowpvqfx

compose multiple variables into a command line, then execute it.


$dest="a:\des"
$source="b:\src"

$cmdlink="cmd"
$cmdPart1="/c", "mklink", "/j"

& $cmdlink $cmdPart1 $dest\juncname1  $source\hello
& $cmdlink $cmdPart1 $dest\juncname2  $source\world
& $cmdlink $cmdPart1 $dest\juncname3  $source\peace