Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-FileSystemFlagsEx should return more then one value #2

Open
Kriegel opened this issue Apr 26, 2021 · 0 comments
Open

Get-FileSystemFlagsEx should return more then one value #2

Kriegel opened this issue Apr 26, 2021 · 0 comments

Comments

@Kriegel
Copy link

Kriegel commented Apr 26, 2021

Hi!

because FileSystemFlagsEx is an Flag Array it should return more tan one value

My CDromDrive returns an FileSystemFlagsEx value of 17301509.
So it should return Get-FileSystemFlagsEx Function should return the following values:

Case Sensitive Search
Unicode On Disk
Read Only Volume

My Function do it like so:

Function Get-FileSystemFlagsEx {

    param ([uint32]$Number)

    if ($Number -ne 0){
        switch ($Number){
            {$Number -band 1} {'Case Sensitive Search'}
            {$Number -band 2} {'Case Preserved Names'}
            {$Number -band 4} {'Unicode On Disk'}
            {$Number -band 8} {'Persistent ACLs'}
            {$Number -band 16} {'File Compression'}
            {$Number -band 32} {'Volume Quotas'}
            {$Number -band 64} {'Supports Sparse Files'}
            {$Number -band 128} {'Supports Reparse Points'}
            {$Number -band 256} {'Supports Remote Storage'}
            {$Number -band 16384} {'Supports Long Names'}
            {$Number -band 32768} {'Volume Is Compressed'}
            {$Number -band 524289} {'Read Only Volume'}
            {$Number -band 65536} {'Supports Object IDS'}
            {$Number -band 131072} {'Supports Encryption'}
            {$Number -band 262144} {'Supports Named Streams'}
            default {"Invalid Code: $Number"}
        }
    }
}

Get-FileSystemFlagsEx 17301509
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant