PowerCLI Reference

Get-SpbmStoragePolicy

Synopsis

This cmdlet returns all available requirement policies and resource policies.

Syntax

Get-SpbmStoragePolicy [[-Name] <String[]>] [-Capability <SpbmCapability[]>] [-Namespace <String[]>] [-Requirement] [-Resource] [-Server <VIServer[]>] [-Tag <Tag[]>] [<CommonParameters>]

Get-SpbmStoragePolicy [-Id <String[]>] [-Server <VIServer[]>] [<CommonParameters>]

Related Commands

Online Version
Export-SpbmStoragePolicy
Import-SpbmStoragePolicy
New-SpbmStoragePolicy
Remove-SpbmStoragePolicy
Set-SpbmStoragePolicy

Detailed Description

This cmdlet returns all available requirement policies and resource policies.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
NameString[]Filters the storage policies by name.falseFalse
CapabilitySpbmCapability[]Filters the storage policies by capability schema.falseFalse
IdString[]Filters the storage policies by ID.


Note: When a list of values is specified for the Id parameter, the returned objects would have an ID that matches exactly one of the string values in that list.
falseFalse
NamespaceString[]Filters the storage policies by namespace.falseFalse
RequirementSwitchParameterSpecifies the policy category. Policy category can be either "requirement" or "resource". If nothing specified, retrieves both.falseFalse
ResourceSwitchParameterSpecifies the policy category. Policy category can be either "requirement" or "resource". If nothing specified, retrieves both.falseFalse
ServerVIServer[]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.falseTrue (ByValue)
TagTag[]Filters the storage policies by tag.falseFalse

Return Type

List of SpbmStoragePolicy objects

Notes

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.html

Examples

-------------------------- Example 1 --------------------------

Get-SpbmStoragePolicy -Name "MyPolicy"

Returns all storage policies named "MyPolicy".

-------------------------- Example 2 --------------------------

Get-SpbmStoragePolicy -Requirement -Namespace "VSAN" -Tag $tag1, $tag2

Returns all storage policies of type Requirement containing one or more rules which contain one or more capabilities from the "VSAN" namespace and any of the $tag1 or $tag2 tags.

-------------------------- Example 3 --------------------------

Get-SpbmStoragePolicy -Id "PolicyId"

Returns a storage policy with ID "PolicyId".


Copyright © VMware, Inc. All rights reserved.