Why can't I choose AliasProperty from WMI?

Given the following:

get-wmiobject win32_networkadapterconfiguration -ComputerName SERVER1,SERVER2|select pscomputername,__SERVER 

Only values ​​for __SERVER . However, PSComputerName is AliasProperty , which points to __SERVER . Therefore, I expect it to return values ​​as well (the same values ​​as mine in __SERVER ).

get-wmiobject win32_networkadapterconfiguration |gm pscomputername,__SERVER returns the following:

 Name MemberType Definition ---- ---------- ---------- PSComputerName AliasProperty PSComputerName = __SERVER __SERVER Property System.String __SERVER {get;set;} 

I am sure I have used PSComputerName in the past, successfully. What am I missing here, that he is failing? This happens with both PowerShell v2 and v3.

+4
source share
1 answer

This has been set on some sites (see CB comment) as well: Powershell PSComputerName is empty or empty when selected after invoke

but there is another problem that I encountered some time ago and was never mentioned (well, not according to my Google search at that time and not now)

Are you trying to request a virtual machine?

because, as far as I know, and I tried, PsComputerName is missing when querying VirtualMachine (VMware in my case).

I did not find a solution for this or a workaround, but I thought it would save you time to search.

If you find something, although I will be more than happy to know it :)

0
source

All Articles