VMware PowerCLI

The Best User Interface for your VMware Datacenter!

get-contentlibraryitem - Add Version and Content Version to returned data

Request: Add Version and Content Version to returned data of Get-ContentLibraryItem cmdlet (or via extension data).

Background: Working with New/Set-ContentLibraryItem and needing to update Description field with updated template info. If submitted on same call it will update the Description field right away before updating the actual OVF content. If upload fails, Description field is already updated and now incorrect. Next run of my update script will not try to update item, but is then needed.

In my script, I'm using REST API to get Content Version before updating Template item. Once update of data is done, I check Content Version again to make sure it incremented. If not, I know it failed and I do not update Description field.

I'd like to complete the entire process via New/Get/Set-ContentLibraryItem cmdlets instead of using 2 different API methods.

  • Eric Lee
  • Mar 17 2020
  • Attach files