Поделиться через


Read-SCLibraryShare

Updates the state and metadata of VMM library objects stored in a library share.

Syntax

Default (Default)

Read-SCLibraryShare
    [-LibraryShare] <LibraryShare>
    [-Path <String>]
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [<CommonParameters>]

Description

The Read-SCLibraryShare cmdlet updates the state and metadata of all Virtual Machine Manager (VMM) library objects stored in the specified library share. This update also finds new library files on the specified library share as well as new child shared folders under the specified library share.

Examples

Example 1: Update a specified library share

PS C:\> $LibShare = Get-SCLibraryShare -VMMServer "VMMServer01.Contoso.com" | where { $_.LibraryServer.Name -eq "LibraryServer01.Contoso.com" -and $_.Name -eq "AllVHDs" }
PS C:\> Read-SCLibraryShare -LibraryShare $LibShare

The first command gets the library share object named AllVHDs on LibraryServer01 from the VMM library on VMMServer01 and then stores the object in the $LibShare variable.

The second command updates the state and metadata information for all library objects in the share stored in $LibShare, and then it adds any new library objects found in the share to the VMM library.

Example 2: Update multiple library shares

PS C:\> $LibShares = Get-SCLibraryShare -VMMServer "VMMServer1.Contoso.com" | where { $_.LibraryServer.Name -eq "LibraryServer01.Contoso.com" -and $_.Name -match "vhd" }
PS C:\> $LibShares | Read-SCLibraryShare

The first command gets the library share objects on LibraryServer01 with the string "vhd" in their names, and then stores the objects in the $LibShares variable.

The second command updates the information for all library shares stored in $LibShares, and then it adds any new library objects found in these shares to the VMM library.

Example 3: Update a specific subdirectory on a library share

PS C:\> $LibShare = Get-SCLibraryShare -VMMServer "VMMServer01.Contoso.com" | where { $_.LibraryServer.Name -eq "LibraryServer01.Contoso.com" -and $_.Name -eq "AllVHDs" }
PS C:\> Read-SCLibraryShare -LibraryShare $LibShare -Path "Production\WebFrontEnd"

The first command gets the library share object named AllVHDs on LibraryServer01 from the VMM library on VMMServer01 and then stores the object in the $LibShare variable.

The second command updates the state and metadata information for all library objects in the specified subdirectory on the library share that is stored in $LibShare, and then it adds any new library objects found in the share to the VMM library.

Parameters

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LibraryShare

Specifies a VMM library share object.

Parameter properties

Type:LibraryShare
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Path

Specifies the destination path for the operation.

Example formats:

  • Local path: -Path "F:\"
  • UNC path: -Path "\\Library\Templates"
  • Volume GUID path: -Path "\\?\Volume{4703c1ea-8ae7-11db-b473-00123f7603e3}\"
  • VMware ESX path: -Path "\[storage1\]\MyVMwareFolderForVMs\MyVM.vmx"
  • Citrix XenServer path: -Path "Local storage\[99b6212f-b63d-c676-25f9-d6c460992de7\]"

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

LibraryShare

This cmdlet returns a LibraryShare object.