leeand00 leeand00 - 6 months ago 66
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}