powershell执行脚本

powershell执行脚本

 

执行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

posted @ 2017-04-09 20:20  特洛伊-Micro  阅读(843)  评论(0编辑  收藏  举报