下载文件:
(new-object System.Net.WebClient).DownloadFile( ‘https://www.abc.com/wac.msi’,’c:\wac.msi’)
开启远程桌面:
(gwmi -class win32_terminalservicesetting -namespace “root\cimv2\terminalservices”).setallowtsconnections(1)
Get-NetFirewallRule -Name RemoteDesktop* | select DisplayName,Direction,Enabled
Get-NetFirewallRule -Name RemoteDesktop* | Set-NetFirewallRule -Enabled true
1