PowerCLI Reference



This cmdlet modifies content library's properties.


Set-ContentLibrary [-SubscribedContentLibrary] <SubscribedContentLibrary[]> [-AutomaticSync] [-Confirm] [-Description <String>] [-DisableAuthentication] [-DownloadContentOnDemand] [-Name <String>] [-Password <String>] [-Server <VIServer[]>] [-SslThumbprint <String>] [-SubscriptionUrl <String>] [-WhatIf] [<CommonParameters>]

Set-ContentLibrary [-LocalContentLibrary] <LocalContentLibrary[]> [-Confirm] [-CurrentPassword <String>] [-Description <String>] [-DisableAuthentication] [-Name <String>] [-Password <String>] [-PersistJson] [-Published] [-Server <VIServer[]>] [-WhatIf] [<CommonParameters>]

Set-ContentLibrary [-SubscribedContentLibrary] <SubscribedContentLibrary[]> [-Confirm] -Evict [-Server <VIServer[]>] [-WhatIf] [<CommonParameters>]

Set-ContentLibrary [-SubscribedContentLibrary] <SubscribedContentLibrary[]> [-Confirm] [-Server <VIServer[]>] -Sync [-WhatIf] [<CommonParameters>]

Related Commands

Detailed Description

This cmdlet modifies content library's properties.


NameTypeDescriptionRequired?Pipeline InputDefault Value
LocalContentLibraryLocalContentLibrary[]A local content library whose properties you want to alter.trueTrue (ByValue)
SubscribedContentLibrarySubscribedContentLibrary[]Specifies a subscribed content library which properties you want to alter.trueTrue (ByValue)
AutomaticSyncSwitchParameterIf specified, synchronization of content library items happens automatically. If not, synchronization happens by using the Set-ContentLibrary cmdlet with the Sync parameter.falseFalse
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
CurrentPasswordStringIndicates if you want to update a password protected content library. Currently set password is supplied to complete the operation.

Note: Available on vCenter Server 6.7 and later.
DescriptionStringSpecifies a human-readable description for the content library that you want to create.falseFalse
DisableAuthenticationSwitchParameterIf specified, disables authentication of the content library.falseFalse
DownloadContentOnDemandSwitchParameterIndicates whether a library item's content is synchronized only on demand.

If specified, the library item's metadata is synchronized, but the item's content (its files) is not synchronized. The Content Library Service synchronizes the content upon request only. This can cause a noticeable delay when using the content for the first time.

If not specified, all content is synchronized in advance.
EvictSwitchParameterRemoves cached content library's items content of a subscribed content library whose content is downloaded on demand.trueFalse
NameStringSpecifies a new name for the content library.falseFalse
PasswordStringSpecifies the password that you want to set or update to the target content library.falseFalse
PersistJsonSwitchParameterSpecifies whether library and library item metadata are persisted in the storage location as JSON files. This flag only applies if you want to publish the local library.

Enabling JSON persistence allows you to synchronize a subscribed library manually instead of over HTTP. 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.
PublishedSwitchParameterSpecifies whether you want to publish the local library.falseFalse
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no given is passed 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
SslThumbprintStringSpecifies 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.
SubscriptionUrlStringSpecifies the URL of the endpoint where the metadata for the remotely published library is served.falseFalse
SyncSwitchParameterIf specified, manually synchronizes the subscribed content library.trueFalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falseFalse

Return Type

Zero or more modified LocalContentLibrary or SubscribedContentLibrary objects



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

PS C:\> $contentLibrary = Get-ContentLibrary -Name 'Content Library' -Local
PS C:\> Set-ContentLibrary -LocalContentLibrary $contentLibrary -Name 'Local Content Library' -Description 'This is local content library.'

Modifies a local content library named 'Content Library' by changing its name to 'Local Content Library' and its description to 'This is local content library.'.

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

PS C:\> $subscribedContentLibrary = Get-ContentLibrary -Name 'Content Library' -Subscribed
PS C:\> Set-ContentLibrary -SubscribedContentLibrary $subscribedContentLibrary -Sync

Manually synchronizes a subscribed content library named 'Content Library'.

-------------------------- Example 3 --------------------------

PS C:\> $subscribedContentLibrary = Get-ContentLibrary -Name 'Content Library' -Subscribed
PS C:\> Set-ContentLibrary -SubscribedContentLibrary $subscribedContentLibrary -Evict

Removes cached content library items' content of subscribed content library that has -DownloadContentOnDemand set.

Copyright © VMware, Inc. All rights reserved.