-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes mounted ISOs when parent VHD/X image creation fails
Fixes #166
- Loading branch information
1 parent
5415b4d
commit dd20d6a
Showing
41 changed files
with
1,570 additions
and
1,502 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
function Add-LabImageWindowsOptionalFeature { | ||
<# | ||
.SYMOPSIS | ||
Enables Windows optional features to an image. | ||
#> | ||
[CmdletBinding()] | ||
param ( | ||
## Source package file path | ||
[Parameter(Mandatory, ValueFromPipeline)] | ||
[ValidateNotNullOrEmpty()] | ||
[System.String] $ImagePath, | ||
|
||
## Mounted VHD(X) Operating System disk drive | ||
[Parameter(Mandatory, ValueFromPipelineByPropertyName)] | ||
[ValidateNotNullOrEmpty()] | ||
[System.String] $DestinationPath, | ||
|
||
## Windows packages to add to the image after expansion | ||
[Parameter(Mandatory, ValueFromPipelineByPropertyName)] | ||
[ValidateNotNull()] | ||
[System.String[]] $WindowsOptionalFeature, | ||
|
||
## DISM log path | ||
[Parameter()] | ||
[ValidateNotNullOrEmpty()] | ||
[System.String] $LogPath = $DestinationPath | ||
) | ||
process { | ||
|
||
WriteVerbose ($localized.AddingWindowsFeature -f ($WindowsOptionalFeature -join ','), $DestinationPath); | ||
$enableWindowsOptionalFeatureParams = @{ | ||
Source = $ImagePath; | ||
Path = $DestinationPath; | ||
LogPath = $LogPath; | ||
FeatureName = $WindowsOptionalFeature; | ||
LimitAccess = $true; | ||
All = $true; | ||
Verbose = $false; | ||
} | ||
$dismOutput = Microsoft.Dism.Powershell\Enable-WindowsOptionalFeature @enableWindowsOptionalFeatureParams; | ||
|
||
} #end process | ||
} #end function Add-LabImageWindowsOptionalFeature |
Oops, something went wrong.