Using Powershell's bitwise operators

后端 未结 2 774
生来不讨喜
生来不讨喜 2021-02-12 10:24

I\'m looking for example of how I would solve the scenario below:

Imagine my printer has the following property for \"Status\"
0 -Offline
2 -Paper Tray Empty

2条回答
  •  后悔当初
    2021-02-12 10:35

    You can let PowerShell do more of the work for you. Here's an example using System.IO.FileOptions:

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

提交回复
热议问题