Closed nwsparks closed 4 years ago
Hi, The CLI is utilizing --query to select specific property to display. You should be able to do similar things with PowerShell:
Get-EMRCluster -ClusterId $clus.Id -Region us-east-1 |Select-Object -ExpandProperty tags
Key Value
ABCD EFG Name new-cluster
@ketanbhut That is the issue, Get-EMRCluster
does not return a tag property. There is no way to retrieve the tags via any of the PS cmdlets.
get-emrclusters -ClusterState 'WAITING' | select -first 1 |GM
TypeName: Amazon.ElasticMapReduce.Model.ClusterSummary
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
Id Property string Id {get;set;}
Name Property string Name {get;set;}
NormalizedInstanceHours Property int NormalizedInstanceHours {get;set;}
Status Property Amazon.ElasticMapReduce.Model.ClusterStatus Status {get;set;}
Hi, Get-EMRCluster is different from get-emrclusters
get-alias Get-EMRClusters|fl
(Get-EMRClusters -ClusterState STARTING |select -fir 1).Gettype()
Get-EMRClusters | foreach {(Get-EMRCluster -ClusterId $_.id).GetType()}
Get-EMRClusters | foreach {Get-EMRCluster -ClusterId $.id |gm Tags} Get-EMRClusters | foreach {Get-EMRCluster -ClusterId $.id | select -expand tags}
I see it now, thanks. I'll close the ticket.
I am unable to find any way to get the tags associated with a cluster via powershell. It looks like it is possible via aws cli:
https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-tags-view.html
can functionality be added to get-emrcluster to return the tags as well?