FunctionsToExport/Function_Get-WindowsImageVHD.ps1

Function Get-WindowsImageVHDSpecs {

    [CmdletBinding()]
    Param(
        [Parameter(Mandatory, ValueFromPipeline)][string]$Location,
        [string]$Path = ".\WindowsImageSpecs.json"
    )

    $MountPath = $VHDPath | Mount-WindowsImageVHD

    [PSCustomObject]@{
        WindowsCapability      = Get-WindowsCapability -Path $MountPath
        WindowsOptionalFeature = Get-WindowsOptionalFeature -Path $MountPath
        AppxProvisionedPackage = Get-AppxProvisionedPackage -Path $MountPath
    }

    $VHDPath | Dismount-WindowsImageVHD

    # $Specs.WindowsCapability | Where-Object { $_.State -eq "Installed" } | Select-Object -ExpandProperty Name | ForEach-Object { "'$_'" }
    # $Specs.WindowsOptionalFeature | Where-Object { $_.State -eq "Enabled" } | Select-Object -ExpandProperty FeatureName | ForEach-Object { "'$_'" }
    # $Specs.AppxProvisionedPackage | Select-Object -ExpandProperty PackageName | ForEach-Object { "'$_'" }
}