Set-ContentLibraryItem

This cmdlet modifies content library item's properties.

Syntax

-ContentLibraryItem  <ContentLibraryItem[]>
[-ClearExistingFiles]
[-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
    Files
    String[] named Specifies the paths to the local files that substitute the current content library item's files.
    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[]>
    -FileName  <String>
    -Uri  <String>
    [-ClearExistingFiles]
    [-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 file name 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 the URI of the file that you want to pull into the content library item.
    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
    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

    PS C:\> $files = Get-ChildItem -File
    PS C:\> $item = Get-ContentLibraryItem -Name 'vm1'
    PS C:\> 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.

    Related Commands

    Feedback

    Was this page helpful?