leeand00 leeand00 - 8 months ago 92
PowerShell Question

What does ?{} mean in PowerShell?

What does a

?{ }
block mean in a PowerShell?

For example

[enum]::GetValues([io.fileoptions]) | ?{$_.value__ -band 0x90000000}


? is an alias for Where-Object. The curly brackets are used if you have to do something more complex with the actual object. You could also write:

[enum]::GetValues([io.fileoptions]) | Where-Object { $_.value__ -band 0x90000000}