共用方式為


Export-SCLibraryPhysicalResource

Exports a library resource form a VMM library share to a local file folder or network share.

Syntax

Default (Default)

Export-SCLibraryPhysicalResource
    [-Path] <String>
    -Resource <ItemBase>
    [-OverwriteExistingFiles]
    [-AllowUnencryptedTransfer]
    [-VMMServer <ServerConnection>]
    [<CommonParameters>]

Description

The Export-SCLibraryPhysicalResource cmdlet exports (copies) a library resource from a Virtual Machine Manager (VMM) library share to a local file folder or network share.

Examples

Example 1: Export a specific library resource to a local file folder

PS C:\> $Resource = Get-SCVirtualHardDisk -Name "VHD01.vhd"
PS C:\> Export-SCLibraryPhysicalResource -Resource $Resource -Path "C:\ExportedLibResources" -OverwriteExistingFiles

The first command gets the virtual hard disk object named VHD01 and stores the object in the $Resource variable.

The second command exports the resource stored in $Resource to the folder named C:\ExportedLibResources. If the resource had been previously exported to this folder, this command would overwrite any of those files.

Example 2: Export a library resource to a network share

PS C:\> $Resource = Get-SCApplicationPackage -Name "WebApp01.zip"
PS C:\> Export-SCLibraryPhysicalResource -Resource $Resource -Path "\\FileShare01\LibExports"

The first command gets the application package object named WebApp01.zip and stores the object in the $Resource variable.

The second command exports the library resource stored in $Resource to the network share named \FileShare01\LibExports.

Parameters

-AllowUnencryptedTransfer

Indicates that network file transfers do not require encryption. If you allow unencrypted network file transfers, it can improve performance if neither the source host nor the destination host requires encryption.

Use this parameter to:

  • Allow unencrypted file transfers into, or out of, the library.
  • Allow unencrypted file transfers into, out of, or within a host group.

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

-OverwriteExistingFiles

Indicates that files with the same name are overwritten when importing or exporting resources into or out of the VMM library.

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

-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:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Resource

Specifies a resource object.

Parameter properties

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

Parameter sets

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

-VMMServer

Specifies a VMM server object.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
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.