【发布时间】:2014-02-05 23:33:19
【问题描述】:
我正在编写一个将启动/停止 hyper-v 虚拟机的 powershell 脚本,但它给出了以下消息:
“Get-VM”一词未被识别为 cmdlet、函数的名称, 脚本文件,或可运行的程序
我发现了这个有用的链接:
http://social.technet.microsoft.com/Forums/windowsserver/en-US/07decd82-270e-4dd0-b8e8-789d693099dd/powershell-getvm-error?forum=winserverpowershellenter link description here
然后我添加了 import-module HyperV 但收到以下消息:
Import-Module:未加载指定的模块“HyperV”,因为没有 在任何模块目录中找到了有效的模块文件 c:\scripts\startStopVMShell.ps1
我在这里找到了一个有用的链接:Power shell: Import-Moduleenter link description here
我在 powershell cmd 行试过这个:
获取模块-listavailable
但它没有列出任何拼写的 HyperV。
我使用的是 Server 2008 R2。如何在我的服务器上获取 HyperV 模块?或者也许我在我的服务器上有它,但 powershell 正在查看当前目录而不是加载模块的位置?
【问题讨论】:
标签: powershell windows-server-2008-r2 hyper-v