hyperv.psm1 - Can this be used as a module in PSv2?

Apr 21, 2009 at 4:47 PM
I have Hyper-V Server R2 beta installed which includes powershell v2.
I found an article (http://blogs.msdn.com/powershell/archive/2008/08/10/all-about-modules.aspx) 
...which asserts that simply renaming the .ps1 as .psm1 and placing it in the "Modules" sub-dir of powershell creates magic...

I've seen several entries regarding how to properly use this library but they all seem to be focued on powershell v1.
Has anyone used this library in Hyper-V Server R2 / powershell v2 environment?

Coordinator
Apr 24, 2009 at 6:44 AM
The code will work as-is on R2.

The plan is to do a proper module for R2 / PowerShell V2 only. I've had a mail from someone who made some minor changes to make the code work as a module, but doing that just changes the way you load the code. Integrating help, tab expansion of parameters etc need a bit of extra work.
Apr 29, 2009 at 10:06 PM
sorry to be the newbie here - but could you give a basic example?
Coordinator
May 5, 2009 at 9:31 AM
OK, if you are running hyper-V R2 server you need to use DISM to enable .NET and then PowerShell. (I'm going to blog about that later today - see blogs.technet.com/jamesone) The code does not need to be changed at all to work on V2, just follow the instructions provided for V1. (i.e. run  .  .\hyperv.ps1).
Most of the dev work was actually done in a pre-release of V2. Sorry when I first read your question I thought you were wanting to make a module
May 14, 2009 at 9:46 PM

Hi James.

Would you be interested in some help in updating this to a full blown V2 Module using Advanced Functions?  I use PowerShell and Hyper-V every day I go to work, so I would be really interested in making this happen.

Andy,

http://get-powershell.com

Andy at get-powershell.com

Coordinator
Jun 7, 2009 at 8:53 AM

Andy, watch this space ... we're doing some work on a the first build of a moudle and then we're going to open things up for contributions.