Skip to content

Use pscustomobject cast for sorted output of $GitPromptSettings - #382

Merged
rkeithhill merged 1 commit into
dahlbyk:masterfrom
lzybkr:sort-settings
Jan 31, 2017
Merged

rkeithhill merged 1 commit into
dahlbyk:masterfrom
lzybkr:sort-settings

Conversation

@lzybkr

@lzybkr lzybkr commented Jan 30, 2017

Copy link
Copy Markdown
Collaborator

To get output sorted like the original source for $GitPromptSettings,
we can use a cast instead of New-Object.

This does change the type of the object in V2 from PSObject to
hashtable, but it doesn't appear to cause any problems because
property syntax works either way.

To get output sorted like the original source for `$GitPromptSettings`,
we can use a cast instead of `New-Object`.

This does change the type of the object in V2 from `PSObject` to
`hashtable`, but it doesn't appear to cause any problems because
property syntax works either way.
@rkeithhill

Copy link
Copy Markdown
Collaborator

Verified. V2 still works (although the properties don't display in definition order). OTOH V5 (and probably V3/4) do display the properties in the order they were defined.

@rkeithhill

Copy link
Copy Markdown
Collaborator

Sufficiently fixes #344 for 0.7.0.

@rkeithhill
rkeithhill merged commit 3b5a853 into dahlbyk:master Jan 31, 2017
@lzybkr
lzybkr deleted the sort-settings branch January 31, 2017 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants