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

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1759398439, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/language/operator/bitwise/index(42): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78