< Back

New-ContentLibraryItem

Sun Jan 19, 2020 6:59 pm

NAME New-ContentLibraryItem



SYNOPSIS

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





SYNTAX

New-ContentLibraryItem [-ContentLibrary] <LocalContentLibrary> [-Confirm] [-Files <String[]>] -Name <String>

[-Notes <String>] [-Server <VIServer[]>] [-WhatIf] [<CommonParameters>]





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

-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.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-ContentLibrary <LocalContentLibrary>

Specifies a local content library that hosts the content library item.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-Files <String[]>

Specifies the paths to local or remote files that you want to add to the newly created content library item.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? 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.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Notes <String>

Specifies a human-readable description for the content library item that you want to create.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? 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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are

modified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

VMware.VimAutomation.ViCore.Types.V1.ContentLibrary.LocalContentLibrary







OUTPUTS

The newly created ContentLibraryItem object







NOTES









-------------------------- 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.



RELATED LINKS