The argument to Split-Path
below is incorrect and it should have been $delZipExe
.
This makes the $delZipCmd
hash be set to nothing.
I would expect WorkingDirectory
value to be set to nothing in the $delZipCmd
hash.
Why does this happens?
Set-StrictMode -Version latest
$delZipExe = '\\servername\ziptools\SP3DDeliverZips.exe'
$delZipDest = "D:\"
$delZipArgs = @( '/execute',
'/source', '/RAD ', '/debugpdb', '/wait'
)
$delZipCmd = @{ FilePath = $delZipExe;
ArgumentList = $delZipArgs;
NoNewWindow = $true;
WorkingDirectory = (Split-Path $delZipCmd); # <== should be $delZipExe
Wait = $true;
}
$delZipCmd | ft