Setting Nullable Enum to $null - Should this really cause PSInvalidCastException? Setting Nullable Enum to $null - Should this really cause PSInvalidCastException? powershell powershell

Setting Nullable Enum to $null - Should this really cause PSInvalidCastException?


This was a bug in PowerShell 4 (and probably 3, but I haven't tried it).

It has been fixed in PowerShell V5 (verified against recent internal builds), I believe it should be fixed in public builds like the September WMF5 preview or Windows 10 preview builds.