cmd或powershell以管理员命令执行PowerShell脚本
比如我的脚本路径:C:\script\psfile.ps1
管理员运行powershell来执行psfile.ps1,命令如下:
powershell -noprofile -command "&{ start-process powershell -ArgumentList '-noprofile -file C:\script\psfile.ps1' -verb RunAs}"
该命令用CMD或Powershell 均可执行
每天早上敲醒自己的不是闹钟,是夢想!