Skip to content

Instantly share code, notes, and snippets.

@mattmcnabb
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattmcnabb/4bb4603337a2c7eb9247 to your computer and use it in GitHub Desktop.
Save mattmcnabb/4bb4603337a2c7eb9247 to your computer and use it in GitHub Desktop.
Is this a bug? What's the deal?
# Add an enum with All constant
Add-Type -TypeDefinition @'
using System;
[Flags]
public enum O365Services
{
AzureActiveDirectory,
Exchange,
Sharepoint,
Skype,
All = AzureActiveDirectory | Exchange | Skype | Sharepoint
}
'@
# Enumerations work as expected
PS c:\> [O365Services]::AzureActiveDirectory
AzureActiveDirectory
PS c:\> [O365Services]::Exchange
Exchange
PS c:\> [O365Services]::Sharepoint
Sharepoint
# Except for whatever is the 4th value
PS c:\> [O365Services]::Skype
All
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment