powershell执行脚本

powershell执行脚本

 

执行powershell脚本有两种方式:

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

C:WindowsSystem32WindowsPowerShellv1.0powershell.exe -version 2.0 -noexit -command ". 'C:UsersAdministratorDesktopmyshell.ps1'"

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

Import-Module C:UsersAdministratorDesktopmyshell.ps1

原文地址:https://www.cnblogs.com/micro-chen/p/6686203.html