Skip to content
This repository was archived by the owner on Mar 11, 2020. It is now read-only.

Commit 15b8db2

Browse files
committed
removing vmdk testing
1 parent c137a52 commit 15b8db2

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

Functions/Private/GetImageType.ps1

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function GetImageType {
1111
#>
1212
[CmdletBinding()]
1313
param (
14-
[ValidateScript({
14+
[ValidateScript({
1515
if (Test-Path -Path $PSItem) { $true }
1616
else { throw 'File does not exist or permission denied.' }
1717
})]
@@ -28,7 +28,7 @@ function GetImageType {
2828
}
2929
Write-Verbose -Message ('Image file {0} contains {1} images' -f $Path, $Image.Count)
3030

31-
### If the file name ends with 'wim', or it has more than one image, then it's a WIM
31+
### If the file name ends with 'wim', or it has more than one image, then it's a WIM
3232
if ($Image.Count -gt 1 -or ($Path -match 'wim$' -and ($Image.ImageName.Length -ge 1))) {
3333
Write-Verbose -Message 'This image appears to be a valid Windows Image Format (WIM) file.'
3434
return [ImageType]::WIM
@@ -39,15 +39,11 @@ function GetImageType {
3939
Write-Verbose -Message 'This image appears to be a valid Virtual Hard Drive (VHDX) file.'
4040
return [ImageType]::VHDX
4141
}
42-
### If the file has a .vmdk extension it is probably a VMDK
43-
if ($Image.Count -ge 1 -and $Path -match 'vmdk$') {
44-
Write-Verbose -Message 'This image appears to be a valid Virtual Machine Disk (VMDK) file. \n If you have the Microsoft Virtual Machine Converter 3.0 installed, we will attempt to convert it. This will take awhile.'
45-
return [ImageType]::VMDK
46-
}
42+
4743
return [ImageType]::Unknown
4844
}
4945
catch {
5046
Write-Error -Message ('Error occurred while attempting to inspect the image file. {0}' -f $PSItem.Exception.Message)
5147
throw $PSItem
5248
}
53-
}
49+
}

Functions/Public/ConvertTo-Dockerfile.ps1

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function ConvertTo-Dockerfile {
1616
Dockerfile will be stored. If you do not specify a path, a temporary directory will be created for you.
1717
1818
.PARAMETER Artifact
19-
Specify the discovery artifacts that will be scanned during the ConvertTo-Dockerfile command.
19+
Specify the discovery artifacts that will be scanned during the ConvertTo-Dockerfile command.
2020
2121
You can obtain the supported list of artifacts by running the Get-WindowsArtifacts command in the same module.
2222
@@ -27,7 +27,7 @@ function ConvertTo-Dockerfile {
2727
[CmdletBinding()]
2828
param (
2929
[Parameter(Mandatory = $true)]
30-
[ValidateScript({
30+
[ValidateScript({
3131
if (!(Test-Path -Path $PSItem)) {
3232
return $false
3333
}
@@ -54,16 +54,14 @@ function ConvertTo-Dockerfile {
5454
### Verify the image type before proceeding
5555
$ImageType = GetImageType -Path $ImagePath
5656
Write-Verbose -Message ('Image type is: {0}' -f $ImageType)
57-
if (!$ImageType -eq 'VMDK') {
58-
try {
57+
try {
5958
### Mount the image to a directory
6059
$Mount = MountImage -ImagePath $ImagePath -MountPath $MountPath
6160
Write-Verbose -Message ('Finished mounting image to: {0}' -f $Mount.Path)
6261
}
6362
catch {
6463
throw 'Fatal error: couldn''t mount image file: {0}' -f $PSItem
6564
}
66-
}
6765

6866
### Perform artifact discovery
6967
if (!$PSBoundParameters.Keys.Contains('Artifact')) {
@@ -78,4 +76,4 @@ function ConvertTo-Dockerfile {
7876
### Dismount the image when inspection is completed
7977
$null = Dismount-WindowsImage -Path $Mount.Path -Discard
8078
Write-Verbose -Message ('Finished dismounting the Windows image from {0}' -f $Mount.Path)
81-
}
79+
}

0 commit comments

Comments
 (0)