Skip to content
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

Changing convertfrom-json utility usage based on powershell version (powershell 6+ has utility for json comments) #755

Merged
merged 4 commits into from
Nov 18, 2023

Conversation

psah434
Copy link
Collaborator

@psah434 psah434 commented Oct 27, 2023

Fixing issue #737
Running the template provided in the above issue, if using the custom ConvertFrom-JSON utility, it fails.
The code change here changes the utility used to be the default powershell version if the powershell major version is equal to or above 6.
There is a small fix in the convertfrom-json utility where for recognizing comments both the starting and ending characters are searched.

@@ -1,5 +1,6 @@
#region JSON Functions
if ($PSVersionTable.PSEdition -ne 'Core') {
#powershell 6+ provides support for json with comments
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please update the description ? I am unableto understand the change made here ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets please update the descriptions for these ...Its really hard to figure out context on these PRs later

@psah434 psah434 changed the title Changing convertfrom-json utility based on powershell version Changing convertfrom-json utility usage based on powershell version (powershell 6+ has utility for json comments) Nov 9, 2023
@psah434 psah434 merged commit 45f84e6 into Azure:master Nov 18, 2023
2 checks passed
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