Set-ContentLibraryItem
This cmdlet modifies the properties of a content library item.
Syntax
Parameters
| Required | Parameter Name | Type | Position | Features | Description | 
|---|---|---|---|---|---|
|                                  required 
                                 | 
                            ContentLibraryItem | ContentLibraryItem[] | named | 
                                
  | 
                            Specifies the content library item whose properties you want to change. | 
| optional | ClearExistingFiles | SwitchParameter | named | 
                                 | 
                            Indicates that if there are any files in the content library item, they will be removed before uploading the new ones. | 
| optional | DisableOvfCertificateChecks | SwitchParameter | named | 
                                 | 
                            Specifies to skip all OVA/OVF certificate checks during the upload to the content library item. | 
| optional | Files | 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 | ItemType | String | named | 
                                 | 
                            Specifies the type of the library item. | 
| optional | Name | String | named | 
                                 | 
                            Specifies a new name for the content library item. | 
| optional | Notes | String | named | 
                                 | 
                            Specifies a new description for the content library item. | 
| optional | ProgressAction | ActionPreference | named | 
                                 | 
                            |
| optional | Server | 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. | 
Parameters
| Required | Parameter Name | Type | Position | Features | Description | 
|---|---|---|---|---|---|
|                                  required 
                                 | 
                            ContentLibraryItem | ContentLibraryItem[] | named | 
                                
  | 
                            Specifies the content library item whose properties you want to change. | 
| optional | ProgressAction | ActionPreference | named | 
                                 | 
                            |
| optional | Server | 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 | Template | named | 
                                
  | 
                            Specifies a virtual machine template to overwrite the original content of the OVF template content library item. | 
| optional | VApp | VApp | named | 
                                
  | 
                            Specifies a VApp object to overwrite the original content of the OVF template content library item. | 
| optional | VM | VirtualMachine | named | 
                                
  | 
                            Specifies a virtual machine to overwrite the original content of the OVF template content library item. | 
Parameters
| Required | Parameter Name | Type | Position | Features | Description | 
|---|---|---|---|---|---|
|                                  required 
                                 | 
                            ContentLibraryItem | ContentLibraryItem[] | named | 
                                
  | 
                            Specifies the content library item whose properties you want to change. | 
|                                  required 
                                 | 
                            FileName | String[] | named | 
                                 | 
                            Specifies a list of 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 
                                 | 
                            Uri | 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 | ClearExistingFiles | SwitchParameter | named | 
                                 | 
                            Indicates that if there are any files in the content library item, they will be removed before uploading the new ones. | 
| optional | DisableOvfCertificateChecks | SwitchParameter | named | 
                                 | 
                            Specifies to skip all OVA/OVF certificate checks during the upload to the content library item. | 
| optional | ItemType | String | named | 
                                 | 
                            Specifies the type of the library item. | 
| optional | Name | String | named | 
                                 | 
                            Specifies a new name for the content library item. | 
| optional | Notes | String | named | 
                                 | 
                            Specifies a new description for the content library item. | 
| optional | ProgressAction | ActionPreference | named | 
                                 | 
                            |
| optional | Server | 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 | SslThumbprint | 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.ContentLibraryItemExamples
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.
Creates a new local or subscribed content library that uses Datastore1 as a repository for its items.
This cmdlet removes the specified content libraries.
This cmdlet modifies content library's properties.
ContentLibraryItem
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 retrieves catalog items from the content library.
This cmdlet creates a new content library item in the specified content library.
This cmdlet removes the specified content library items.
This cmdlet modifies content library item's properties.