yplong

比如我的脚本路径:C:\script\psfile.ps1

管理员运行powershell来执行psfile.ps1,命令如下:
powershell -noprofile -command "&{ start-process powershell -ArgumentList \'-noprofile -file C:\script\psfile.ps1\' -verb RunAs}"

 

该命令用CMD或Powershell 均可执行

分类:

技术点:

相关文章:

  • 2021-12-04
  • 2021-05-14
  • 2021-10-16
  • 2021-12-04
  • 2021-05-02
  • 2021-10-07
  • 2021-12-04
猜你喜欢
  • 2019-02-27
  • 2021-12-04
  • 2021-05-09
  • 2021-08-21
  • 2021-12-26
  • 2021-08-25
相关资源
相似解决方案