powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Get-CustomAttribute



NAME
Get-CustomAttribute

SYNOPSIS
Retrieves custom attributes.

SYNTAX
Get-CustomAttribute [-Id ] [[-Name] ] [[-TargetType] ] [-Global] [
-Server ] []


DESCRIPTION
Retrieves custom attributes. A custom attribute is a user-defined description field of one or more vSphere objects.


PARAMETERS
-Id
Specify the Ids of the custom attributes you want to retrieve.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-Name
Specify the names of the custom attributes you want to retrieve.

Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? true

-TargetType
Specify a target type to filter the custom attributes by the type of objects to which they can be applied. The
valid values are VirtualMachine, ResourcePool, Folder, VMHost, Cluster, Datacenter, and $null. If the value is
$null the custom attribute is global and applies to all target types.

Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Global
Indicates that only global custom attributes are retrieved. A global custom attribute can be applied both to ho
sts and virtual machines.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Server
Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the co
mmand runs on the default servers. For more information about default servers, see the description of Connect-V
IServer.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
CustomAttribute[]


NOTES




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

C:\PS>Get-CustomAttribute -Global


Retrieves all global custom attributes.





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

C:\PS>Get-CustomAttribute -TargetType "VirtualMachine", "VMHost"


Retrieves all custom attributes of type VirtualMachine and VMHost.





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

C:\PS>Get-CustomAttribute -Name "Creation*" -Global


Retrieves only global custom attributes that match the specified name pattern.






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Get-CustomAttribute.html
New-CustomAttribute
Remove-CustomAttribute
Set-CustomAttribute
Get-Annotation
Set-Annotation