利用powershell写个ssh连接从另一台计算机下载桌面的图片代码 - 网络技能论坛 - 经验分享 - 小轻秀场

利用powershell写个ssh连接从另一台计算机下载桌面的图片代码

你可以使用如下的Powershell脚本来实现:

$creds = Get-Credential
$s = New-PSSession -ComputerName remotehostname -Credential $creds
Invoke-Command -Session $s -ScriptBlock {
$url = "http://example.com/image.jpg"
$destination = "C:/MyFolder/image.jpg"
(New-Object System.Net.WebClient).DownloadFile($url, $destination)
}
请登录后发表评论

    没有回复内容