This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Install Windows from a passed ISO. | |
.DESCRIPTION | |
This command takes a path to a .iso file, mounts it, and starts setup.exe to begin windows installation. | |
This should only be run on Windows PE instances. | |
.PARAMETER ISOPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uses http://www.ltr-data.se/opencode.html/#ImDisk virtual disk driver for windows 7 or less | |
# Tries to use chocolatey to install imdisk | |
# Sample use case: | |
# Import-Module ".\mount.iso.psm1" | |
# Invoke-IsoExe "C:\test.iso" "setup.exe" "/passive" | |
function Mount-Iso([string] $isoPath) | |
{ | |
if ( -not (Test-Path $isoPath)) { throw "$isoPath does not exist" } |