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.
VMware PowerCLI and prerequisite is software installed. See Install Image Builder PowerCLI and Prerequisite Software.
If you encounter problems running PowerCLI cmdlets, consider changing the execution policy. See Using Image Builder Cmdlets.
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.
In a PowerShell window, check whether any software depots are defined for the current session.
PowerShell returns the currently defined depots, or nothing if you just started PowerShell.
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.
Download the ZIP file to a local file path.
Run Add-EsxSoftwareDepot -DepotUrl C:\file_path\offline-bundle.zip
PowerShell adds the specified depot to your current session and lists all current depots.
Check the $DefaultSoftwareDepots variable, which now returns the newly-added depot.
Display all currently available image profiles.
The list helps you pick a likely candidate for cloning.
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"
Display the newly created image profile.
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 -Name "new_profile_name" -Vendor "my_vendor" $ip