PowerCLI Reference



This cmdlet creates a new content library item in the specified content library.


New-ContentLibraryItem [-ContentLibrary] <LocalContentLibrary> [-Confirm] [-Files <String[]>] -Name <String> [-Notes <String>] [-Server <VIServer[]>] [-WhatIf] [<CommonParameters>]

Related Commands

Detailed Description

This cmdlet creates a new content library item in the specified content library. If the Files parameter is specified, you can add the specified files to the newly created content library item.


NameTypeDescriptionRequired?Pipeline InputDefault Value
ContentLibraryLocalContentLibrarySpecifies a local content library that hosts the content library item.trueTrue (ByValue)
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falseFalse
FilesString[]Specifies the paths to local or remote files that you want to add to the newly created content library item.falseFalse
NameStringSpecifies the name of the library item. The library item names cannot be undefined or an empty string. Names do not have to be unique.trueFalse
NotesStringSpecifies a human-readable description for the content library item that you want to create.falseFalse
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet.falseFalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falseFalse

Return Type

The newly created ContentLibraryItem object



-------------------------- Example 1 --------------------------

PS C:\> $files = Get-ChildItem -File
PS C:\> $localContentLibrary = Get-ContentLibrary -name 'Local content library' -Local
PS C:\> New-ContentLibraryItem -ContentLibrary $localContentLibrary -name 'New item' -Files $files

Creates a content library item named 'New item' in the 'Local content library' library. Containing all the files from the C: directory.

Copyright © VMware, Inc. All rights reserved.