我要从serverA复制文件内容,并且必须将该文件放置在serverB中。
code :
$nodefile="D:\Batch\final\$nodelog"
$server="D:\J\config\logs"
$nodepool="Node-small"
$nodelog='12345.log'
$get=Invoke-Command -Computername $Servername -ScriptBlock{Copy-Item $using:server\$using:nodepool\$using:nodelog - destination $using:nodefile}
错误:
Could not find a part of the path
'D:\Batch\final\Node-12345.log'.
+ CategoryInfo : NotSpecified: (:) [Copy-Item], DirectoryNotFound
Exception
+ FullyQualifiedErrorId : System.IO.DirectoryNotFoundException,Microsoft.P
owerShell.Commands.CopyItemCommand
+ PSComputerName : SERVER A