Syntax
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.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ContentLibrary | LocalContentLibrary | Specifies a local content library that hosts the content library item. | true | True (ByValue) | |
Confirm | SwitchParameter | If 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. | false | False | |
Files | String[] | Specifies the paths to local or remote files that you want to add to the newly created content library item. | false | False | |
Name | String | Specifies the name of the library item. The library item names cannot be undefined or an empty string. Names do not have to be unique. | true | False | |
Notes | String | Specifies a human-readable description for the content library item that you want to create. | false | False | |
Server | VIServer[] | 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. | false | False | |
WhatIf | SwitchParameter | Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | False |
Return Type
The newly created ContentLibraryItem objectNotes
Examples
-------------------------- 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.