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'返回的結果? –