PowerShell命令行导入模块
我在模块M1下有一个cmdlet。我需要从命令行本身运行cmdlet。比如说,PowerShell命令行导入模块,powershell,powershell-2.0,Powershell,Powershell 2.0,我在模块M1下有一个cmdlet。我需要从命令行本身运行cmdlet。比如说,powershell-Command cmdlet1 但我需要在运行cmdlet1之前导入模块M1。有没有一种方法可以让我一次性完成 我不想与PowerShell交互,但我想像运行普通Windows命令一样运行cmdlet1。尝试: powershell -command "& { import-module M1; cmdlet1 }" 或者只是: powershell -command "import
powershell-Command cmdlet1
但我需要在运行cmdlet1
之前导入模块M1。有没有一种方法可以让我一次性完成
我不想与PowerShell交互,但我想像运行普通Windows命令一样运行cmdlet1
。尝试:
powershell -command "& { import-module M1; cmdlet1 }"
或者只是:
powershell -command "import-module M1; cmdlet1 "
尝试:
或者只是:
powershell -command "import-module M1; cmdlet1 "