On the Internet there are many examples of powershell scripts to list the members of a local group. Such scripts look like follow:

$group = [ADSI]"WinNT://$($env:COMPUTERNAME)/Administrators"
$group.Invoke("Members") | foreach {$_.GetType().InvokeMember("Name", 'GetProperty', $null, $_, $null)}

This script fails in case of "orphaned" accounts which SIDs can't be resolved with an error message:

Error while invoking GetType. Could not find member.
+ ...  | foreach {$_.GetType().InvokeMember("Name", 'GetProperty', $null, $ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], MissingMemberException
    + FullyQualifiedErrorId : System.MissingMemberException

Workaround is to invoke the GetType method through a PSMethod reference as shown below:

$group = [ADSI]"WinNT://$($env:COMPUTERNAME)/Administrators"
$group.Invoke("Members") | foreach {$_."GetType".Invoke().InvokeMember("Name", 'GetProperty', $null, $_, $null)}