Syntax
Export-SpbmStoragePolicy [-FilePath] <String> [-StoragePolicy] <SpbmStoragePolicy> [-Force] [-Server <VIServer>] [-Confirm] [-WhatIf] [<CommonParameters>]Related Commands
Online VersionDetailed Description
This cmdlet exports the specified storage policy to a file. If the Force parameter is not specified and the destination file exists or the target parent directory does not exist, a terminating error is generated.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
FilePath | String | Specifies the path to the file or directory where you want to export the storage policy. | true | False | |
StoragePolicy | SpbmStoragePolicy | Specifies the storage policy you want to export. | true | True (ByValue) | |
Confirm | SwitchParameter | If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. | false | False | |
Force | SwitchParameter | Indicates whether the cmdlet overwrites the existing destination files. | false | False | |
Server | VIServer | Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. | false | False | |
WhatIf | SwitchParameter | Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | False |
Return Type
System.IO.FileInfo for the exported fileNotes
Works only with vCenter Server 5.5 or later. For more information, see the VMware Storage Policy API Reference: https://pubs.vmware.com/vsphere-60/index.jsp#com.vmware.vspsdk.apiref.doc/right-pane.htmlExamples
-------------------------- Example 1 --------------------------
Export-SpbmStoragePolicy -StoragePolicy $policy -FilePath C:\policies\
Exports a storage policy to a file in C:\policies\. If the C:\policies\ directory exists, a file with the name of the policy is created in this directory.
-------------------------- Example 2 --------------------------
Export-SpbmStoragePolicy -StoragePolicy $policy -FilePath C:\policy.xml -Force
Exports a storage policy to the policy.xml file in C:\. If a file with the same name already exists in this location, the file is overwritten.
Note: If you do not use the Force parameter, the command returns an error about the existing file.