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]

Parameters

Required Parameter Name Type Position Features Description
required
ContentLibraryItem
ContentLibraryItem[] named
  • wildcards
  • pipeline
  • 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
    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.

    -ContentLibraryItem  <ContentLibraryItem[]>
    [-Server  <VIServer[]>]
    [-Template  <Template>]
    [-VApp  <VApp>]
    [-VM  <VirtualMachine>]
    [CommonParameters]

    Parameters

    Required Parameter Name Type Position Features Description
    required
    ContentLibraryItem
    ContentLibraryItem[] named
  • wildcards
  • pipeline
  • Specifies the content library item whose properties you want to change.
    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
  • wildcards
  • pipeline
  • Specifies a virtual machine template to overwrite the original content of the OVF template content library item.
    optional
    VApp
    VApp named
  • wildcards
  • pipeline
  • Specifies a VApp object to overwrite the original content of the OVF template content library item.
    optional
    VM
    VirtualMachine named
  • wildcards
  • pipeline
  • 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]

    Parameters

    Required Parameter Name Type Position Features Description
    required
    ContentLibraryItem
    ContentLibraryItem[] named
  • wildcards
  • pipeline
  • Specifies the content library item whose properties you want to change.
    required
    FileName
    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
    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
    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.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

    Feedback

    Was this page helpful?