How can I get vmname, vmtagcategory and vmtag value side by side with powercli
PS C:\Users\test> Get-Tag
Name Category Description
---- -------- -----------
Technichal Operations Department
Marketing Department
Information Technologies Unit
Network Operations Unit
Sales Unit
PS C:\Users\test> Get-TagAssignment -Entity lin-1
Tag Entity
--- ------
Department/Technichal Operations lin-1
Unit/Information Technologies lin-1
Example
Name Department Unit
---- ---------- ------
Lin-1 Technichal Operations Information Technologies
Lin-2 Technichal Operations Network Operations
Would this work?
Get-TagAssignment | Group-Object -property Entity | %{
$obj = [ordered]@{
Name = $_.Name
}
$_.Group | %{
if(!$obj.Contains($_.Tag.Category.Name)){
$obj.Add($_.Tag.Category.Name,$_.Tag.Name)
}
}
New-Object PSObject -Property $obj
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Would this work?
Get-TagAssignment | Group-Object -property Entity | %{
$obj = [ordered]@{
Name = $_.Name
}
$_.Group | %{
if(!$obj.Contains($_.Tag.Category.Name)){
$obj.Add($_.Tag.Category.Name,$_.Tag.Name)
}
}
New-Object PSObject -Property $obj
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Great Thank you for reply.