You can use Image Builder cmdlets to check which depots are available, to add a depot, to display image profile information, and to create a new image profile by cloning one of the available image profiles.

Before you use the cmdlets in this workflow, make sure your environment meets the following requirements.

Published profiles are usually read only and cannot be modified. Even if a published profile is not read only, cloning instead of modifying the profile is a best practice, because modifying the original profile erases the original. You cannot revert to the original, unmodified profile except by reconnecting to a depot.

A profile cloning workflow might include checking the current state of the system, adding a software depot, and cloning the profile.

  1. In a PowerShell window, check whether any software depots are defined for the current session.

    $DefaultSoftwareDepots

    PowerShell returns the currently defined depots, or nothing if you just started PowerShell.

  2. If necessary, add the depot that includes the profile you want to clone to the current session.

    For remote depots, run Add-EsxSoftwareDepot -DepotUrl depot_url.

    For an offline depot ZIP file, you must download the ZIP file first.

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

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

    PowerShell adds the specified depot to your current session and lists all current depots.

  3. Check the $DefaultSoftwareDepots variable, which now returns the newly-added depot.

    $DefaultSoftwareDepots

  4. Display all currently available image profiles.

    Get-EsxImageProfile

    The list helps you pick a likely candidate for cloning.

  5. Clone one of the image profiles by specifying the name displayed in the Name column, a name for the new profile, and the vendor.

    $ip = New-EsxImageProfile -CloneProfile base-tbd-v1 -Name "Test Profile 42" -Vendor "Vendor20"

  6. Display the newly created image profile.

    $ip

    Name                Vendor          Last Modified          Acceptance Level
    ----                ------          -------------          ----------------
    Test Profile 42     Vendor20        9/15/2010 5:45:43...   PartnerSupported
    

Creating Image Profile by Cloning Using Variables

This sample cmdlet sequence repeats the steps of this workflow, but passes parameters as objects, accessed by position in a variable, instead of passing parameters by name. You can run the following cmdlets in sequence from the PowerCLI prompt.

$DefaultSoftwareDepots
Add-EsxSoftwareDepot -DepotUrl depot_url
$DefaultSoftwareDepots
$profs = Get-EsxImageProfile
$profs
$ip = New-EsxImageProfile -CloneProfile $profs[2] -Name "new_profile_name" -Vendor "my_vendor"
$ip