【问题标题】:trying to import hyperv not working尝试导入 hyperv 不起作用
【发布时间】: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


    【解决方案1】:

    Windows PowerShell 的 Hyper-V 模块是作为 Windows Server 2012 操作系统的一部分引入的。在“相同”名称下有一个 CodePlex 项目,您可以将其移植到 2008 R2。

    PowerShell Management Library for Hyper-V

    让我知道这对你有什么好处。 Related blog post.

    【讨论】:

    • 你从那里下载过吗?当我转到 Gold 下载时,它在推荐下载下列出了 PSHyperv-R2,当我选择它时,它正在下载 pdf 文件,但我认为它不会下载其他任何东西,例如 hyper-v 模块。
    • 就像我在我的电脑上运行它,然后在 powershell 中使用 它没有列出 hyperv。
    • 我没有安装 Michele,所以很抱歉我无法在这方面提供更多帮助,因为我没有在 2008 R2 上运行 Hyper-V 虚拟机。
    • 我下载了。非常感谢! pdf文件下载一次,zip文件下载一次。
    猜你喜欢
    • 2021-10-20
    • 1970-01-01
    • 2016-05-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-08
    • 2021-10-18
    • 1970-01-01
    相关资源
    最近更新 更多