You can compare two image profiles by using the Compare-EsxImageProfile cmdlet, for example, to see if they have the same VIB list or acceptance level . Comparing image profiles or their properties is also possible by using the PowerShell comparison operators.
Procedure
- In a PowerCLI session, run the Add-EsxSoftwareDepot cmdlet for each depot you want to work with.
Option |
Action |
Remote depot |
Run Add-EsxSoftwareDepot -DepotUrl <depot_url> . |
ZIP file |
- Download the ZIP file to a local file system.
- Run
Add-EsxSoftwareDepot -DepotUrl C:\<file_path>\<offline-bundle>.zip
|
The cmdlet returns one or more
SoftwareDepot objects.
- (Optional) Run the Get-EsxImageProfile cmdlet to view a list of all image profiles in all available depots.
In the list, you can locate the names of the image profiles you want to compare.
- Before comparing the image profiles, assign them to variables.
For example, you can create variables
$imageProfile1
and
$imageProfile2
to hold the names of the compared images profiles.
$imageProfile1
= Get-EsxImageProfile -Name "ImageProfile1"
$imageProfile2
= Get-EsxImageProfile -Name "ImageProfile2"
- Compare the two image profiles by using the Compare-EsxImageProfile cmdlet or the
-eq
comparison operator, which returns a Boolean value.
- Compare the two image profiles to get a full description of the differences by using the Compare-EsxImageProfile cmdlet.
Compare-EsxImageProfile -ReferenceProfile
$imageProfile1 -ComparisonProfile $imageProfile2
- Compare the two image profiles by VIB list and acceptance level using the
-eq
comparison operator. if ($imageProfile1 -eq $imageProfile2) {
Write-host "Successfully verified that both image profiles are equal."
} else {
Write-host "Failed to verify that the image profiles are equal."
}
- Compare the two image profiles by a specific property using the
-eq
comparison operator. if ($imageProfile1.vendor -eq $imageProfile2.vendor) {
Write-host "Successfully verified that both image profiles are equal."
} else {
Write-host "Failed to verify that the image profiles are equal."
}