Skip to content

New-Object Hashtable makes properties case sensitive #2440

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

Closed
kilasuit opened this issue Oct 6, 2016 · 2 comments
Closed

New-Object Hashtable makes properties case sensitive #2440

kilasuit opened this issue Oct 6, 2016 · 2 comments
Labels
Issue-Discussion the issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif Resolution-By Design The reported behavior is by design.

Comments

@kilasuit
Copy link
Collaborator

kilasuit commented Oct 6, 2016

Raising here as per reported at PoshCode/PowerShellPracticeAndStyle#60
and PowerShell/PowerShellGet#7

@lzybkr lzybkr added the Issue-Discussion the issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif label Oct 7, 2016
@lzybkr
Copy link
Contributor

lzybkr commented Oct 7, 2016

This is by design. You are calling the default constructor of a class in .Net. To do anything else would be incorrect.

@GeeLaw
Copy link

GeeLaw commented Oct 7, 2016

If you want case-insensitive HashTable, pass an appropriate IHashCodeProvider and an appropriate IEqualityComparer. There is an overload available among the constructors.

I guess when you @{}, you get case-insensitive hash code provider and equality comparer.

@joeyaiello joeyaiello added the Resolution-By Design The reported behavior is by design. label Oct 7, 2016
@lzybkr lzybkr closed this as completed Oct 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Discussion the issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif Resolution-By Design The reported behavior is by design.
Projects
None yet
Development

No branches or pull requests

4 participants