我需要将文件从本地计算机复制到远程计算机,
使用以下命令但不起作用,请帮助
$Stat = $null
$Source = "C:\Temp\test\"
$Destination = "C:\temp\"
$Stat = Invoke-Command -ComputerName $server -ScriptBlock {
Copy-Item -Path $Source -Destination $Destination
} -Credential $user
错误:
Cannot bind argument to parameter 'Path' because it is null. + CategoryInfo : InvalidData: (:) [Copy-Item], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CopyItemCommand