Defining custom properties for Select-Object in a text file

I agree with Olaf, there are probably better ways to handle this. However, to make your example functional, you can use invoke-expression on the calculated properties

$List = Get-Content myPropertyList.txt | Foreach-Object {
    if($_ -match '^@'){
        $_ | Invoke-Expression
    }
    else{$_}
}

$output | ? {$_.ID -eq 4733} | Select-Object $list
1 Like