Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to create a VHD (virtual disk). I know this can be done with diskpart

create vdisk file C:\w7.vhd maximum 10

However I am trying to do it with PowerShell. I found the New-VHD Cmdlet, however it appears to only work with Windows 8 and I am using Windows 7. How can I use New-VHD with Windows 7, or failing that is another way available?

share|improve this question
    
Did you install PowerShell 4.0 (which is the version that command is valid for)? To get it on Windows 7 you'll need to install the Windows Management Framework 4.0. –  Ƭᴇcʜιᴇ007 Apr 28 '14 at 20:21
    
@techie007 I already have that installed, no dice. –  Steven Penny Apr 28 '14 at 20:51
    
I wonder if you would get the new-vhd commandlet if you installed the Hyper-V Remote Administration tools. –  Zoredache Apr 28 '14 at 23:40
    
@Zoredache where is that –  Steven Penny Apr 28 '14 at 23:43

2 Answers 2

Indeed, the New-VHD CmdLet is only available for Windows Server 2012 R2 and Windows 8.1.

Info : http://technet.microsoft.com/en-us/library/hh848503.aspx

Thus, you should use diskpart or the GUI to create a VHD. Notice you can use diskpart in a script. Here are two posts that should help you :

http://www.tech-recipes.com/rx/9910/how-to-automate-windows-diskpart-commands-in-a-script/

and

http://mohamedradwan.wordpress.com/2012/02/23/create-a-vhd-and-add-it-to-the-boot-menu-using-bcdedit-command/

Hope this helps.

share|improve this answer

An alternative that works for me is to use VirtualBox to create the VHD

create

And Windows 7 installer to format it

format

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.