cmd:
解除powershell 脚本执行权限
powershell -noprofile Set-ExecutionPolicy Unrestricted
powershell 下载文件 执行文件
$client = new-object System.Net.WebClient
$client.DownloadFile('\\DW-PC\Users\sd\xx.msi', 'D:\1.msi')
D:\1.msi /q
部署到域中执行
本文介绍如何使用PowerShell设置脚本执行策略并下载远程文件进行安装。通过设置执行策略为Unrestricted来允许脚本运行,并演示了使用PowerShell的WebClient对象下载指定路径的文件并执行。
cmd:
解除powershell 脚本执行权限
powershell -noprofile Set-ExecutionPolicy Unrestricted
powershell 下载文件 执行文件
$client = new-object System.Net.WebClient
$client.DownloadFile('\\DW-PC\Users\sd\xx.msi', 'D:\1.msi')
D:\1.msi /q
部署到域中执行

被折叠的 条评论
为什么被折叠?