VMware Cloud Community
NickSousa
Contributor
Contributor
Jump to solution

Exploring Namespace Classes

In PowerGUI it will let you explore a namespace like "vmware.vimautomation.vicore.types.v1.srm.server" by revealing the classes within the namespace each step of the way, but I was wondering how you can explore namespaces in general without having to go down this route? Is there documentation that lists off all of the classes for each namespace as it relates to PowerCLI?

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Afaik there is no such reference, but can the following perhaps help ?

[appdomain]::CurrentDomain.GetAssemblies() | where {$_.Location -match 'vSphere PowerCLI'} | %{

  $_.GetTypes() | Where {$_.IsPublic} |

  Select Name,Namespace

} 


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Afaik there is no such reference, but can the following perhaps help ?

[appdomain]::CurrentDomain.GetAssemblies() | where {$_.Location -match 'vSphere PowerCLI'} | %{

  $_.GetTypes() | Where {$_.IsPublic} |

  Select Name,Namespace

} 


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
NickSousa
Contributor
Contributor
Jump to solution

Yes that is exactly what I was looking for, thank you! To view the SRM classes, I modified the script remove the "where" filter (

where {$_.Location -match 'vSphere PowerCLI'}), and dumped the contents into a CSV file. I'm sure we could narrow it down a bit to find where the SRM classes are located, but this suited my needs.

0 Kudos