April 7, 2010

How to list enumeration type values ?

[enum]::getvalues([System.IO.FileAttributes])

Or you can use this function made my $hay@Israel :

function Get-EnumValues{[enum]::getvalues($args[0]) | select @{n="Name";e={$_}},@{n="Value";e={$_.value__}} | ft -auto } 

No comments:

Post a Comment