每次运行脚本时,我都会在访问远程服务器时收到此错误,请检查所有数据是否正确。尝试使用Invoke-Command
。输出相同。
有什么想法吗?
$cred = Get-Credential
$cred
$SourceFilePFX = "\\Certificate\Location"
$SourceFileCER = "\\Certificate\Name"
$Destination = "\\Server\Directory"
Copy-Item -Path $args[0],$args[1] -Destination $args[3] -ArgumentList $SourceFileCER,$SourceFilePFX,$Destination -Credential $cred
Copy-Item : Cannot bind argument to parameter 'Path' because it is null. At line:6 char:18 + Copy-Item -Path $SourceFileCER, $args[1] -Destination $Destination + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Copy-Item], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CopyItemCommand