< Back

New-ContentLibrary

Sun Jan 19, 2020 6:59 pm

NAME New-ContentLibrary



SYNOPSIS

Creates a new local or subscribed content library that uses Datastore1 as a repository for its items.





SYNTAX

New-ContentLibrary [-Datastore] <Datastore> [-AutomaticSync] [-Confirm] [-Description <String>]

[-DownloadContentOnDemand] -Name <String> [-Password <String>] [-Server <VIServer[]>] [-SslThumbprint <String>]

-SubscriptionUrl <String> [-WhatIf] [<CommonParameters>]



New-ContentLibrary [-Datastore] <Datastore> [-Confirm] [-Description <String>] -Name <String>

[-OptimizeRemotePublishing] [-Password <String>] [-PersistJson] -Published [-Server <VIServer[]>] [-WhatIf]

[<CommonParameters>]





DESCRIPTION

This cmdlet creates a new new local or subscribed content library depending on the provided parameters.





PARAMETERS

-AutomaticSync [<SwitchParameter>]

Specifies whether the library should participate in automatic library synchronization. If you want to do an

automatic synchronization, the global Automatic Sync option must be enabled.



The subscription is still active even when automatic synchronization is turned off, but synchronization is

only done manually by using the -Sync parameter of the Set-ContentLibrary cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-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



-Datastore <Datastore>

Specifies the datastore that you want to use to store files for library items in this library.



Required? true

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Description <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DownloadContentOnDemand [<SwitchParameter>]

Indicates whether a library item's content is synchronized only on demand.



If specified, then the library item's metadata is synchronized but the item's content (its files) is not. The

Content Library Service synchronizes the content upon request only. This can cause the first use of the

content to have a noticeable delay.



If not specified, all content is synchronized in advance.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies the name of the library. Library 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



-OptimizeRemotePublishing [<SwitchParameter>]

If specified, the library is optimized for remote publishing and the Published parameter is required.



This parameter specifies if remote publishing is the dominant use case for this library. The remote publishing

occurs when the publisher and subscribers are not part of the same vCenter Single Sign-On domain.



Any optimizations can be done as a result of turning on this optimization during library creation. For

example, library content could be stored in different formats, but optimizations are not limited to just a

storage format.



You can set the value of this toggle only during the creation of the library and you need to migrate your

library in case you need to change this value (optimize the library for a different use case).



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Password <String>

Specifies the password you want to use for the content library.



If you want to create a local content library, the password is required from subscribers in Basic

authentication mode.



If you want to subscribe to a content library, the password should be in Basic authentication mode.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PersistJson [<SwitchParameter>]

Specifies whether library and library item metadata are persisted in the storage location as JSON files. This

flag only applies if the local library is published.



You can copy the local library content and metadata to another storage location manually and then create a

subscribed library referencing the location of the library JSON file in the SubscriptionUrl. When the

subscribed library's storage location matches the subscription URL, you do not need to copy the files to the

subscribed library.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Published [<SwitchParameter>]

Specifies whether you need to publish the local library.



Required? true

Position? named

Default value False

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



-SslThumbprint <String>

Specifies an optional SHA-1 hash of the SSL certificate for the remote endpoint.



If this value is defined, the SSL certificate is verified by comparing it to the SSL thumbprint. The SSL

certificate must be verified against the thumbprint. When specified, the standard certificate chain validation

behavior is not used.



The certificate chain is validated normally if this value is unset.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SubscriptionUrl <String>

Specifies the URL of the endpoint where the metadata for the remotely published library is served.



Required? true

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

None







OUTPUTS

The newly created ContentLibrary derived object - LocalContentLibrary or SubscribedContentLibrary







NOTES









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



PS C:\\> New-ContentLibrary -Name 'Local Content Library' -Description 'Local content library description.'

-Datastore $Datastore1 -Published



Creates a new local content library that uses Datastore1 as a repository for its items.

-------------------------- Example 2 --------------------------



PS C:\\> $localContentLibrary = Get-ContentLibrary -Name 'Local Content Library' -Local

PS C:\\> New-ContentLibrary -Name 'Subscribed Content Library' -Description 'Subscribed content library

description.' -Datastore $Datastore1 -SubscriptionUrl $localContentLibrary.PublishUrl



Creates a new subscribed content library that is subscribed to $localContentLibrary and uses Datastore1 as a

repository for its items.



RELATED LINKS