< Back

Get-SpbmStoragePolicy

Sun Jan 19, 2020 7:15 pm

NAME 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>]





DESCRIPTION

This cmdlet returns all available requirement policies and resource policies.





PARAMETERS

-Capability <SpbmCapability[]>

Filters the storage policies by capability schema.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-Id <String[]>

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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String[]>

Filters the storage policies by name.



Required? false

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-Namespace <String[]>

Filters the storage policies by namespace.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-Requirement [<SwitchParameter>]

Specifies the policy category. Policy category can be either "requirement" or "resource". If nothing

specified, retrieves both.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Resource [<SwitchParameter>]

Specifies the policy category. Policy category can be either "requirement" or "resource". If nothing

specified, retrieves both.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? 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.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-Tag <Tag[]>

Filters the storage policies by tag.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

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/inde ... -pane.html



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



RELATED LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... olicy.html

Export-SpbmStoragePolicy

Import-SpbmStoragePolicy

New-SpbmStoragePolicy

Remove-SpbmStoragePolicy

Set-SpbmStoragePolicy