PowerCLI Reference

Get-SpbmStoragePolicy

Synopsis

This cmdlet returns all available requirement policies and resource policies.

Syntax

Get-SpbmStoragePolicy [-Requirement] [-Resource] [[-Name] <String[]>] [-Namespace <String[]>] [-Capability <SpbmCapability[]>] [-Tag <Tag[]>] [-Server <VIServer[]>] [<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.