复制远程计算机时出现问题

时间:2017-08-11 08:18:23

标签: powershell

我需要将文件从本地计算机复制到远程计算机,

使用以下命令但不起作用,请帮助

$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

0 个答案:

没有答案