0
有没有什么办法可以调用一个获取远程服务器上文件内容的命令,然后将内容写入本地机器上的文件?从Powershell中的远程服务器中检索文件
希望这样的事情:
Invoke-Command -ComputerName ###.##.###.## { $file= Get-Content C:\Windows\System32\drivers\etc\hosts } -Credential $cred
$file | Out-File \\path\to\local\machine
谢谢你,工作就像一个魅力! –
如果我使用'-AsJob'标志怎么办?我如何访问'Get-Content'的结果而不是'-AsJob'返回的结果? –