Export-SpbmStoragePolicy Command | Vmware PowerCLI Reference

Export-SpbmStoragePolicy

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.If the folder specified for the FilePath parameter exists, the policy name is used to name the target file. The Force and Destination parameters follow the rules described in PowerCLI Usability Guidelines, Destination and Force parameters.

Syntax

Export-SpbmStoragePolicy
[ -StoragePolicy ] < SpbmStoragePolicy >
-FilePath < String >
[-Force ]
[-ProgressAction < ActionPreference > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
StoragePolicy SpbmStoragePolicy 1
  • pipeline
  • wildcards
Specifies the storage policy you want to export.
required
FilePath String named
Specifies the path to the file or directory where you want to export the storage policy.
optional Force SwitchParameter named
Indicates whether the cmdlet overwrites the existing destination files.
optional ProgressAction ActionPreference named
optional Server VIServer[] named
  • wildcards
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 Connect-VIServer.

Output

System.IO.FileInfo

Examples

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.

Related Commands

SpbmStoragePolicy

This cmdlet exports the specified storage policy to a file.

This cmdlet returns all available requirement policies and resource policies.

This cmdlet imports a storage policy from a file.

This cmdlet creates a requirement storage policy in an SPBM server.

This cmdlet deletes storage policies.

This cmdlet overrides the current name, description, and rule sets of an existing storage policy in an SPBM server.