Search notes:

PowerShell: bitwise operators

-band, -bor, bxor, -bnot, -shl and -shr are bitwise operators. They focus on single bits in integral values.

Testing for bits in enumerations

The -band operator can be used to test if a given flag is set in an enum with flag characteristics
if ( (get-item foo.txt).attributes -band [System.IO.FileAttributes]::Offline) {
   write-host 'File has offline attribute'
}
else {
   write-host 'File does not have offline attribute'
}

Index