Dynamically get PSCustomObject property and values

前端 未结 5 1951
走了就别回头了
走了就别回头了 2020-12-31 13:48

I have the following:

$test = [pscustomobject]@{
    First = \"Donald\";
    Middle = \"Fauntleroy\";
    La         


        
5条回答
  •  -上瘾入骨i
    2020-12-31 14:20

    Not sure if it is really better, but here's one more variant:

    $test.psobject.Members | ? {$_.Membertype -eq "noteproperty"} | 
        %{ $_.Name + '='+  $_.Value }
    

提交回复
热议问题