0

I'm getting some unique results with this little guy

clear
$Datas = @{}
$Datas["Database1"] = "440"
$Datas["Database2"] = "140"
$Datas["Database3"] = "210"
$Datas | sort value

The Results are:

Name                           Value                                                                                                                                                         
----                           -----                                                                                                                                                         
Database3                      210                                                                                                                                                           
Database1                      440                                                                                                                                                           
Database2                      140

The results should be:

Name                           Value                                                                                                                                                         
----                           -----                                                                                                                                                         
Database2                      140
Database3                      210                                                                                                                                                           
Database1                      440                                                                                                                                                           

Any idea what I am missing? Any reading material to dive into?

1 Answer 1

1

This blog solves your problem. In short, try this:

$Datas.GetEnumerator() | sort value

value is not necessary (sort by value by default). Use name to sort by name.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.