You can compare two VIBs or their properties by using the PowerShell comparison operators.

Before you begin

Install the PowerCLI and all prerequisite software. See Install vSphere ESXi Image Builder and Prerequisite Software.

Procedure

  1. 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

    1. Download the ZIP file to a local file system.

    2. Run Add-EsxSoftwareDepot -DepotUrl C:\file_path\offline-bundle.zip

    The cmdlet returns one or more SoftwareDepot objects.

  2. (Optional) : Run the Get-EsxSoftwarePackage cmdlet to view all available VIBs.

    In the list, you can locate the names of the VIBs you want to compare.

  3. Before comparing the VIBs, assign them to variables.

    For example, you can create variables $vib1 and $vib2 to hold the names of the compared VIBs.

    $vib1 = Get-EsxSoftwarePackage -Name "ReferenceVIB"
    $vib2 = Get-EsxSoftwarePackage -Name "ComparisonVIB"
  4. Use a comparison operator to compare the VIBs by contents and acceptance level or by a specific property.
    • Compare the two VIBs by their contents and acceptance level.

         if ($vib1 -eq $vib2) {
            Write-host "Successfully verified that both VIBs are equal."
         } else {
            Write-host "Failed to verify that the VIBs are equal."
         }
    • Compare a specific property of the VIBs by using a comparison operator such as -eq, -lt, -le, -gt or -ge.

         if ($vib1.VersionObject -lt $vib2.VersionObject) {
            Write-host "Successfully verified that both the VIBs are equal."
         } else {
            Write-host "Failed to verify that the VIBs are equal."
         }