Skip to content

Instantly share code, notes, and snippets.

@googl
Created June 23, 2015 13:44
Show Gist options
  • Save googl/a8c3184b4c1888492955 to your computer and use it in GitHub Desktop.
Save googl/a8c3184b4c1888492955 to your computer and use it in GitHub Desktop.
powershell disk image idea
Step 1 - Create the VHD
diskpart Create vdisk file=”c:\test\test.vhd” maximum=1000
select vdisk file="c:\test\test.vhd"
attach vdisk
create partition primary
assign letter=X noerr
exit
Step 2 - Copy the files into your new vhd
Robocopy <Source> <Destination> *.* /S /MT:128
Step 3 - Detach the vhd
select vdisk file="c:\test\test.vhd"
detach vdisk
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment