Tip: You can get the names / values of an Enumeration object by using the GetEnumNames or GetEnumValues static method.
You can identify enumeration by the Enum keyword.
Here is an example with thefile attributes from System.IO namespace.
FileAttributes Enumeration
https://msdn.microsoft.com/en-us/library/system.io.fileattributes(v=vs.110).aspx
1 2 |
[System.Enum]::GetNames('System.IO.FileAttributes') [System.Enum]::GetValues('System.IO.FileAttributes') |
Note: For versions prior to PowerShell v3 :
1 2 |
[System.IO.FileAttributes].GetEnumNames() [System.IO.FileAttributes].GetEnumValues() |
To see the list of enumerations from System.IO Namespace :
System.IO Namespace
https://msdn.microsoft.com/en-us/library/system.io(v=vs.110).aspx