This shows you the differences between two versions of the page.
Last revision Both sides next revision | |||
diskimagescript-usage [2014/08/21 18:39] anashwan Created wiki page for the Windows diskimage creation PowerShell script. |
diskimagescript-usage [2014/08/22 18:23] gsamfira |
||
---|---|---|---|
Line 8: | Line 8: | ||
#### Start a PowerShell session from _cmd_: | #### Start a PowerShell session from _cmd_: | ||
``` | ``` | ||
- | > start powershell | + | start powershell |
``` | ``` | ||
Line 14: | Line 14: | ||
#### Download and install _git_: | #### Download and install _git_: | ||
``` | ``` | ||
- | PS> | + | (New-Object System.Net.WebClient).DownloadFile(" |
- | PS> | + | cmd.exe /C call $HOME\Git-1.9.0-preview20140217.exe /SILENT |
``` | ``` | ||
#### For _qcow2 conversion support_, download and install the latest _qemu_ tools(as of the making of this article, build date 08.01.2014): | #### For _qcow2 conversion support_, download and install the latest _qemu_ tools(as of the making of this article, build date 08.01.2014): | ||
``` | ``` | ||
- | PS> | + | (New-Object System.Net.WebClient).DownloadFile(" |
- | PS> | + | cmd.exe /C call $HOME\qemu-w64-setup-20140801.exe /SILENT |
``` | ``` | ||
#### Add all dependencies to path, both to the environment variable and for the current session: | #### Add all dependencies to path, both to the environment variable and for the current session: | ||
``` | ``` | ||
- | PS> | + | $newPath = " |
- | PS> | + | $env:Path = $newPath |
- | PS> | + | setx PATH $newPath |
``` | ``` | ||
Line 34: | Line 34: | ||
## Getting the script: | ## Getting the script: | ||
``` | ``` | ||
- | PS> | + | cd $HOME |
- | PS> | + | git clone https:// |
``` | ``` | ||
Line 43: | Line 43: | ||
#### Start a new PowerShell session as administrator: | #### Start a new PowerShell session as administrator: | ||
``` | ``` | ||
- | PS> | + | Start-Process PowerShell -Verb RunAs |
``` | ``` | ||
Line 49: | Line 49: | ||
### Getting at the _.wim_ file of an _.iso_: | ### Getting at the _.wim_ file of an _.iso_: | ||
``` | ``` | ||
- | PS> | + | $mountpoint = Mount-DiskImage -ImagePath C: |
- | PS> | + | $wimfilePath = ($mountpoint | Get-Volume).DriveLetter + ": |
# AFTER succesfully using the .wim in the script, don't forget to dismount the .iso: | # AFTER succesfully using the .wim in the script, don't forget to dismount the .iso: | ||
- | PS> | + | Dismount-DiskImage -ImagePath C: |
``` | ``` | ||
### Creating a _.vhd_: | ### Creating a _.vhd_: | ||
``` | ``` | ||
- | PS> | + | cd $HOME\windows-diskimage-builder\windows-diskimage-builder |
# previous steps for obtaining the $wimfilePath are assumed to have been done | # previous steps for obtaining the $wimfilePath are assumed to have been done | ||
- | PS> | + | .\diskimagebuilder.ps1 -SourceFile $wimfilePath -VHDFile $HOME\resultingDiskImage.vhd -VHDSize 16 |
``` | ``` | ||
* *Notes:* | * *Notes:* | ||
Line 69: | Line 69: | ||
### Creating a _.qcow2_: | ### Creating a _.qcow2_: | ||
``` | ``` | ||
- | PS> | + | .\diskimagebuilder.ps1 -SourceFile $wimfilePath -VHDFile $HOME\resultingDiskImage.vhd -VHDSize 16 -OutputFormat qcow2 |
``` | ``` | ||
* **Notes:** | * **Notes:** |