Solved

Powershell Hyper-V Module on Server 2012 R2

Posted on 2014-10-14
2
588 Views
Last Modified: 2014-11-12
I don't use powershell very much and I don't know if it's just me - but it seems every time I need to use powershell (and I always happen to be on different versions of Windows server) that something is different and even though I documented how I did something last time, it simply doesn't work in all cases.

Here's where I'm stuck today...

I'm on a Windows Server 2012 R2 machine, it has the Hyper-V role installed (and has running VM machines)


I'm trying to get a list of all VM's and the virtual network that their NIC is connected to.

But my issue is at the very basics, I can't even get output from "Get-VM"

I type it in, and nothing happens (no error, but no output, I just end up at the next line)

PS C:\> Get-VM
PS C:\>


If I type this:
Get-Command –Module Hyper-V

I get a list of all the Cmdlet's, for example:


CommandType     Name                                               ModuleName
-----------     ----                                               ----------
Cmdlet          Add-VMDvdDrive                                     Hyper-V
Cmdlet          Add-VMFibreChannelHba                              Hyper-V
Cmdlet          Add-VMHardDiskDrive                                Hyper-V
Cmdlet          Add-VMMigrationNetwork                             Hyper-VCommandType     Name                                               ModuleName
-----------     ----                                               ----------
Cmdlet          Add-VMDvdDrive                                     Hyper-V
Cmdlet          Add-VMFibreChannelHba                              Hyper-V
Cmdlet          Add-VMHardDiskDrive                                Hyper-V
Cmdlet          Add-VMMigrationNetwork                             Hyper-V
...etc

Open in new window




Just in case, I also imported the Hyper-V module like this:

PS C:\> Import-Module “C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Hyper-V\Hyper-V.psd1”
PS C:\>


Here is the Powershell version info:

PS C:\> $psversiontable

Name                           Value
----                           -----
PSVersion                      4.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.34011
BuildVersion                   6.3.9600.16394
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2

Open in new window




So what am I missing?  If the Hyper-V module wasn't installed I assume typing Get-VM would give me an error, but it doesn't, yet it doesn't give any output either.

Also, if you can advise on the full command to list all VM's and their virtual switches that would be helpful too.


Thanks in advance
0
Comment
Question by:Vas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
Abdul Khadja Alaoudine earned 500 total points
ID: 40379666
Are you running PowerShell as administrator? If not, make sure you running it as administrator.
0
 
LVL 1

Author Comment

by:Vas
ID: 40379698
OMG that was it thank you!

Wow Microsoft could have at least added some kind of permissions error instead of nothing, they have no issues spitting out errors in Powershell for everything else.


Thanks Abdul.
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ransomware is a malware that is again in the list of security  concerns. Not only for companies, but also for Government security and  even at personal use. IT departments should be aware and have the right  knowledge to how to fight it.
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question