执行powershell脚本有两种方式:

1、通过命令行参数启动脚本

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -version 2.0 -noexit -command ". 'C:\Users\Administrator\Desktop\myshell.ps1'"

2、通过Import-Module命令导入脚本

Import-Module C:\Users\Administrator\Desktop\myshell.ps1

执行powershell脚本有两种方式:

1、通过命令行参数启动脚本

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -version 2.0 -noexit -command ". 'C:\Users\Administrator\Desktop\myshell.ps1'"

2、通过Import-Module命令导入脚本

Import-Module C:\Users\Administrator\Desktop\myshell.ps1

相关文章:

  • 2021-12-04
  • 2021-05-14
  • 2019-02-27
  • 2021-12-04
  • 2021-11-28
猜你喜欢
  • 2021-11-21
  • 2022-12-23
  • 2021-12-04
  • 2021-12-26
  • 2022-01-24
  • 2021-11-28
  • 2021-08-05
相关资源
相似解决方案