Bitwise Operators


If you find yourself needing binary or bitwise operations, PowerShell has the requisite operators as shown in Table 6.4:

image from book
Table 6.4: PowerShell Bitwise Operators
Open table as spreadsheet

Operator

Definition

-band

binary and

-bor

binary or

-bnot

binary not

image from book

The underlying binary math is beyond the scope of this book. However, here are some examples if you need to perform a bitwise comparison:

 PS C:\> 255 -band 255 255 PS C:\> 255 -band 150 150 PS C:\> 32 -bor 16 48 PS C:\> 

In each case the value that is returned from the comparison is the digital equivalent of the underlying bitwise operation.



Windows PowerShell. TFM
Internet Forensics
ISBN: 982131445
EAN: 2147483647
Year: 2004
Pages: 289

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net