With VMware.Image Builder cmdlets, you can take advantage of all PowerCLI features.
VMware.Image Builder cmdlets are implemented as Microsoft PowerShell cmdlets and included in PowerCLI. You can take advantage of all PowerCLI features by using VMware.Image Builder cmdlets. Experienced PowerShell users can use VMware.Image Builder cmdlets just like other PowerShell cmdlets. If you are new to PowerShell and PowerCLI, follow these tips.
You can type cmdlets, parameters, and parameter values in the PowerCLI shell.
- Get help for any cmdlet by running
Get-Help cmdlet_name
. - Remember that PowerShell is not case sensitive.
- Use tab completion for cmdlet names and parameter names.
- Format any variable and cmdlet output by using
Format-List
orFormat-Table
or their short formsfl
orft
. SeeGet-Help Format-List
. - Use wildcards for searching and filtering VIBs and image profiles. All wildcard expressions are supported.
Passing Parameters by Name
You can pass in parameters by name in most cases and surround parameter values that contain spaces or special characters with double quotes.
Add-EsxSoftwarePackage -ImageProfile profile42 -SoftwarePackage "partner package 35"
Passing Parameters as Objects
You can pass parameters as objects if you want to do scripting and automation. You can use the technique with cmdlets that return multiple objects or with cmdlets that return a single object.
- Bind the output of a cmdlet that returns multiple objects to a variable.
$profs = Get-EsxImageProfile
- When you run the cmdlet that needs the object as input, access the object by position, with the list starting with 0.
Add-EsxSoftwarePackage -ImageProfile $profs[4] -SoftwarePackage partner-pkg
The example adds the specified software package to the fifth image profile in the list returned by Get-EsxImageProfile.
Most of the examples in the vCenter Server Installation and Setup documentation pass in parameters by name. vSphere ESXi Image Builder Workflows with PowerCLI Cmdlets includes examples that pass parameters as objects.
VMware.ImageBuilder Cmdlets Overview
The VMware.Image Builder component of VMware PowerCLI provides cmdlets for managing VIBs, image profiles, and other content in software depots.
vSphere 7.0 and later introduce new ways of packaging VIBs along with legacy bulletins and patches, and software depots contain base images, vendor addons and components, along with VIBs and image profiles. VMware PowerCLI 12.0 and later provide cmdlets that work with the new content in software depots.
Cmdlet | Description |
---|---|
Add-EsxSoftwareDepot | Adds the software depot or ZIP file at the specified location to your current environment. Downloads metadata from the depot and analyzes VIBs for dependencies. |
Remove-EsxSoftwareDepot | Disconnects from the specified software depot. |
Get-EsxSoftwareDepot | Returns a list of software depots that are in the current environment. If you want to examine and manage image profiles and VIBs, you must first add the corresponding software depot to your environment. |
Get-EsxSoftwarePackage | Returns a list of software package objects (VIBs). Use this cmdlet's options to filter the results. |
Get-EsxImageProfile | Returns an array of ImageProfile objects from all currently added depots. |
New-EsxImageProfile | Creates a new image profile. In most cases, creating a new profile by cloning an existing profile is recommended. See Clone an Image Profile with PowerCLI Cmdlets. |
Set-EsxImageProfile | Modifies a local ImageProfile object and performs validation tests on the modified profile. The cmdlet returns the modified object but does not persist it. |
Export-EsxImageProfile | Exports an image profile as either an ESXi ISO image for ESXi installation, or as a ZIP file. |
Compare-EsxImageProfile | Returns an ImageProfileDiff structure that shows whether the two profiles have the same VIB list and acceptance level. See Working with Acceptance Levels. |
Remove-EsxImageProfile | Removes the image profile from the software depot. |
Add-EsxSoftwarePackage | Adds one or more new packages (VIBs) to an existing image profile. |
Remove-EsxSoftwarePackage | Removes one or more packages (VIBs) from an image profile. |
Set-ESXImageProfileAssociation | Associates the specified image profile with the specified ESXi system. |
Cmdlet | Description |
---|---|
Get-DepotAddons | Retrieves an array of objects that provide basic information about addons in a software depot. |
Get-DepotBaseImages | Retrieves an array of objects that provide basic information about base images in a software depot. |
Get-DepotComponents | Retrieves an array of objects that provide basic information about components in a software depot. |
Get-DepotInfo | Retrieves basic information about the software depot located at the specified file path or URL address. |
Get-DepotVibs | Retrieves an array of objects that provide basic information about VIBs in a software depot. |
New-IsoImage | Generates an ISO image by using the specified software depot and software specification at the specified file path. |
New-PxeImage | Generates a PXE image by using the specified software depot and software specification at the specified file path. |