What’s New for Content Library Management

Welcome to the new year from the PowerCLI team! The first blog of the year is to look at some of the improvements to the way we manage one of the hidden gems of vSphere, Content Library. Little known fact, Content Library was one of the very first services in vCenter which was offered through a REST API as part of the vSphere 6.0 release! Since then, there’s been numerous updates and improvements to the Content Library. These updates have been discussed in the following blog by my teammate Nigel Hickey: The Evolution of Content Library

Late last year, we released PowerCLI 11.5. This new version included quite a few updates and number of new cmdlets to manage things like vCenter Alarms, VMware Cloud on AWS, and Content Library.

The new cmdlets for Content Library management are as follows:

  • New-ContentLibraryItem
  • Set-ContentLibraryItem
  • Remove-ContentLibraryItem
  • Export-ContentLibraryItem
  • New-ContentLibrary
  • Set-ContentLibrary
  • Get-ContentLibrary
  • Remove-ContentLibrary

As part of a tandem blog post with Nigel, we’re going to walk through interacting with a Content Library. Nigel will handle the tasks from the vSphere Client side over on the vSphere blog post “Creating and Using Content Library” and I’ll be showing how to do those same tasks with the new PowerCLI cmdlets here!

Creating a Local Content Library

First things first, in order to manage a Content Library, we need to create one. Luckily, one of the new cmdlets turns this process from roughly a 10-line process into, essentially, a one-liner!

The key pieces of information we need to make note of prior to creating a new local Content Library by running the New-ContentLibrary cmdlet:

  • Name
  • Description (optional, but recommended)
  • Whether publishing should be enabled
  • Datastore location

For my environment, I can use the following code to create a new local Content Library:

Demo: Creating a Content Library

Adding Items to Content Library

A Content Library can be used to store and share a number of things. From VMs to templates, scripts to certificates, we can import and make use of these items from any vCenter which has access. The first item we’ll be adding to our new Content Library is going to be a PowerShell script, which is small and simple to import.

For this task, we will want to identify a script to import and get familiar with the new cmdlet, New-ContentLibraryItem. This cmdlet has a couple parameters we will need to populate:

  • ContentLibrary: the Content Library we are looking to interact with
  • Files: the file/s to be imported to the Content Library
  • Name: the name of the item displayed in the Content Library

I’ll be referencing a script from one of the last PowerCLI blogs, Get-TriggeredAlarms.ps1, which I have stored in a local git repository.

We can use the following code to create a new Content Library item by importing our PowerCLI script:

Sample: Import Content Library Item

Exporting Items from Content Library

We have created a Content Library and imported our first item. The next step would be to use that item. There’s no native way to run, or even modify, our imported script, so we will want to export the script so we can run it from our local PowerShell session. In order to do this, we will use another new cmdlet named Export-ContentLibraryItem

There are two main parameters we will need to use for this task:

  • ContentLibraryItem: the item we’re looking to export
  • Destination: this is the location of where the item should be downloaded and stored to

We can use the following code to export our script from the Content Library:

Sample: Export Content Library Item

Remove Item from Content Library

For our last task, we’re going to complete the lifecycle of a Content Library item by removing our PowerCLI script. In order to accomplish this task, PowerCLI has another new cmdlet which can simplify this task to a single line by using Remove-ContentLibraryItem

There’s only one parameter we need to be concerned with, and that is the following:

  • ContentLibraryItem: this is the item we’re looking to remove

We can use the following code to remove our script from the Content Library:

Sample: Remove Content Library Item


Content Library is one of those vSphere features with so much untapped potential. This blog post took a look at how the release of PowerCLI 11.5 can streamline the management of a Content Library and the entire lifecycle of those items it contains.

Let us know in the comments how you’re using PowerCLI to automate the Content Library!

More information about PowerCLI 11.5’s release: New Release – PowerCLI 11.5.0
More information about performing these tasks in the vSphere Client: Creating and Using Content Library


46 comments have been added so far

  1. Are you looking for the optimum yet affordable SEO Packages? Don’t go beyond, we have designed our SEO Packages in Delhi to match your economy as well as to get ranking on SERP.

  2. Plan a visit to Chardham as this yatra will take you to another world of beautiful landscapes with dense mountain forests, large valleys, waterfalls, flowing rivers etc. Arrow Aircraft provides Chardham Yatra by Helicopter. Get the best Chardham Helicopter Booking Price by Arrow AirCraft.

  3. There is still a big in New-ContentLibraryItem, I dont see a way to specify the file type. Example if I upload an ISO file, it is unmount able to a VM because the type is “file” , the web API has a parameter called type but just not the PowerCLI. I would be happy to help code this but I’m unsure as to where to begin.

  4. Thanks you so much for being my wife. there is nothing more than wishing a wife a happy wedding anniversary. thus I came up with this new colllection of anniversary messages that you can share with your life partener.

  5. I was recently tasked with migrating hundreds of ISO files from NFS to leverage the new content library functionalities, so naturally I turned to Powershell. I noticed that all of the ISOs were uploading as filetype “file” as opposed to filetype “Iso”. This is a big problem, because Isos can’t be mounted to a machine in VCenter without them being recognized as filetype “Iso”.

    I ended up fixing the problem by manipulating the VCenter database directly (which I do not recommend under normal circumstances), however, a parameter to set the filetype while uploading with Powershell would have saved me a lot of time and a big headache. Is this a feature that could be added? Or is there a safer way to fix this problem?

  6. Hey, Kylle Ruddy, Thanks for sharing this amazing post. At first, I was a little confused about removing the item from the content library. But your blog has cleared all my doubt. I learnt a couple of new and interesting things I didn’t know about. You must have spent hours in the research! Great Job, Kylle 🙂

  7. I really appreciate you for publishing this blog here about what’s new content library; it’s really a helpful and very useful for us. This is really appreciated that you have presented this data over here, I love all the information shared. Great article!Do check out this, it has some great and nice ideas to look for.

  8. I really appreciate you for publishing this blog here about what’s new content library; it’s really a helpful and very useful for us. This is really appreciated that you have presented this data over here, I love all the information shared. Great article!I have seen similar information at one place, you can also see on

  9. I am so happy I found your blog and I absolutely love your information about whats new content library and the tips you have shared are awesome. I liked and it is wonderful to know about so many things that are useful for all of us! Thanks a lot for this amazing blog!!

  10. This wonderful article is addressing on the new content library. I loved reading this article. Here the tips and tricks for addressing such are mentioned. Such content must be made more and more available. Thank you for this article!! This is really very informative.Do check out this it has some great and nice ideas to look for.

  11. Wonderful article. It’s very useful. As a news service provider, I really appreciate your post.
    checkout Washington News Post : Latest News ,World News ,USA News

  12. Someone Sometimes with visits your blog regularly and recommended it in my experience to read as well. The way of writing is excellent and also the content is top-notch. Thanks for that insight you provide the readers!

  13. Thanks for taking the time to discuss that, I feel strongly about this and so really like getting to know more on this kind of field. Do you mind updating your blog post with additional insight? It should be really useful for all of us.

  14. ProVen Review ProVen is not precisely the weight-loss dietary supplement that everybody is looking for. Judging from the ingredients, it works more as an antioxidant of sorts. If you want a better immune system and healthier cardiovascular health, then you should certainly try this product out.proven supplement @

  15. The instructions on how to take ProVen are clearly explained on the bottle. As I knew the ProVen supplement would help me to detox, I took it in the morning. As the supplement only contains natural ingredients, the body recognizes it as food and digests it quickly.

Leave a Reply

Your email address will not be published. Required fields are marked *