更新时间:2023-02-21 19:08:36
如果只想执行代码if
,address
具有member
streets
,则可以测试一下:
If you want to execute the code only if
the address
has the member
streets
you can test for just that:
if (
($FileContent.address | Get-Member -MemberType NoteProperty -Name "streets") -ne $null
){
$FileContent.address = $FileContent.address | Select-Object * -ExcludeProperty streets
}