Set-ContentLibraryItem
This cmdlet modifies the properties of a content library item.
Syntax
-ContentLibraryItem
<ContentLibraryItem[]>
[-ClearExistingFiles]
[-DisableOvfCertificateChecks]
[-Files <String[]>]
[-ItemType <String>]
[-Name <String>]
[-Notes <String>]
[-Server <VIServer[]>]
[CommonParameters]
[-ClearExistingFiles]
[-DisableOvfCertificateChecks]
[-Files <String[]>]
[-ItemType <String>]
[-Name <String>]
[-Notes <String>]
[-Server <VIServer[]>]
[CommonParameters]
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required |
|
ContentLibraryItem[] | named |
|
Specifies the content library item whose properties you want to change. | optional |
|
SwitchParameter | named |
|
Indicates that if there are any files in the content library item, they will be removed before uploading the new ones. | optional |
|
SwitchParameter | named |
|
Specifies to skip all OVA/OVF certificate checks during the upload to the content library item. | optional |
|
String[] | named |
|
Specifies the paths to the local files that substitute the current content library item's files. Note: If the Files parameter is not specified, the content library item's files do not get altered. | optional |
|
String | named |
|
Specifies the type of the library item. | optional |
|
String | named |
|
Specifies a new name for the content library item. | optional |
|
String | named |
|
Specifies a new description for the content library item. | optional |
|
VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value 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. |
-ContentLibraryItem
<ContentLibraryItem[]>
[-Server <VIServer[]>]
[-Template <Template>]
[-VApp <VApp>]
[-VM <VirtualMachine>]
[CommonParameters]
[-Server <VIServer[]>]
[-Template <Template>]
[-VApp <VApp>]
[-VM <VirtualMachine>]
[CommonParameters]
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required |
|
ContentLibraryItem[] | named |
|
Specifies the content library item whose properties you want to change. | optional |
|
VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value 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. | optional |
|
Template | named |
|
Specifies a virtual machine template to overwrite the original content of the OVF template content library item. | optional |
|
VApp | named |
|
Specifies a VApp object to overwrite the original content of the OVF template content library item. | optional |
|
VirtualMachine | named |
|
Specifies a virtual machine to overwrite the original content of the OVF template content library item. |
-ContentLibraryItem
<ContentLibraryItem[]>
-FileName <String[]>
-Uri <String[]>
[-ClearExistingFiles]
[-DisableOvfCertificateChecks]
[-ItemType <String>]
[-Name <String>]
[-Notes <String>]
[-Server <VIServer[]>]
[-SslThumbprint <String>]
[CommonParameters]
-FileName <String[]>
-Uri <String[]>
[-ClearExistingFiles]
[-DisableOvfCertificateChecks]
[-ItemType <String>]
[-Name <String>]
[-Notes <String>]
[-Server <VIServer[]>]
[-SslThumbprint <String>]
[CommonParameters]
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required |
|
ContentLibraryItem[] | named |
|
Specifies the content library item whose properties you want to change. | required |
|
String[] | named |
|
Specifies a list file names that you want to use for the file pulled by the content library item from the URI specified in the Uri parameter. | required |
|
String[] | named |
|
Specifies a list of URIs of the file that you want to pull into the content library item. Note: http://, https://, and ds:// uris are acceptable. | optional |
|
SwitchParameter | named |
|
Indicates that if there are any files in the content library item, they will be removed before uploading the new ones. | optional |
|
SwitchParameter | named |
|
Specifies to skip all OVA/OVF certificate checks during the upload to the content library item. | optional |
|
String | named |
|
Specifies the type of the library item. | optional |
|
String | named |
|
Specifies a new name for the content library item. | optional |
|
String | named |
|
Specifies a new description for the content library item. | optional |
|
VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value 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. | optional |
|
String | named |
|
Specifies the SSL thumbprint of the server hosting the file specified by the URI in the Uri parameter. |
Output
VMware.VimAutomation.ViCore.Types.V1.ContentLibrary.ContentLibraryItem
Examples
Example 1
$files = Get-ChildItem -File
$item = Get-ContentLibraryItem -Name 'vm1'
Set-ContentLibraryItem -ContentLibraryItem $item -Name 'New name' -Files $files
Modifies the content library item named 'vm1' by setting its name to 'New name' and updates its files to the current content of the C: directory.
Example 2
$item = Get-ContentLibraryItem -Name 'vm1'
Set-ContentLibraryItem -ContentLibraryItem $item -ItemType 'file'
Modifies the content library item named 'vm1' by setting its type to 'file'.
Example 3
$item = Get-ContentLibraryItem -Name 'vm1'
Set-ContentLibraryItem -ContentLibraryItem $item -Uri 'http://10.23.112.235:81/ISOs/Photon-minimal-3.0.iso' -FileName 'Photon-minimal-3.0.iso'
Modifies the content library item named 'vm1' by adding the 'Photon-minimal-3.0.iso' file from the specified URI.
Example 4
$vm = Get-VM -Name 'MyVM'
$item = Get-ContentLibraryItem -Name 'OVF template library item'
Set-ContentLibraryItem -ContentLibraryItem $item -VM $vm
Modifies the content library item named 'OVF template library item' by updating the OVF template content from the 'MyVM' virtual machine.
Related Commands
ContentLibrary
This cmdlet creates a new local or subscribed content library.
This cmdlet modifies content library's properties.
This cmdlet removes the specified content libraries.
Creates a new local or subscribed content library that uses Datastore1 as a repository for its items.
ContentLibraryItem
This cmdlet retrieves catalog items from the content library.
This cmdlet copies content library items to a local content library.
This cmdlet exports content library item's files to the local machine.
This cmdlet modifies content library item's properties.
This cmdlet removes the specified content library items.
This cmdlet creates a new content library item in the specified content library.