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 @ 2015-04-01 14:53  MrHacker  阅读(711)  评论(0编辑  收藏  举报