-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add -Path and -LiteralPath parameters to Test-Json cmdlet
#19042
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
Merged
daxian-dbw
merged 33 commits into
PowerShell:master
from
ArmaanMcleod:test-json-file-parameter
Feb 21, 2023
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
62c651e
Add Path parameter to Test-Json cmdlet
ArmaanMcleod 517c2a7
Fix parameter sets
ArmaanMcleod 88d9dba
Add tests
ArmaanMcleod 5b27f83
Use -Path in tests
ArmaanMcleod f8edd3a
Remove empty line between try/catch
ArmaanMcleod 4e0e6ea
Fixing more codefactor issues
ArmaanMcleod 2a6889f
Make added code consistent with code factor changes
ArmaanMcleod 9570bc3
Put asset test paths at the start of BeforeAll block
ArmaanMcleod 8c62387
Adding more tests
ArmaanMcleod 9627832
Fix comment in tests
ArmaanMcleod ad5ab60
Put assets path into variable
ArmaanMcleod 2973df5
Adding test for value from pipeline
ArmaanMcleod c2847c3
Fixing up value from pipeline tests
ArmaanMcleod 0cd4ee6
Fix schema param in test
ArmaanMcleod e90b3d2
Remove extra whitespace
ArmaanMcleod 73b1187
Use TestDrive and remove asset files
ArmaanMcleod a153f68
Remove Aggregate exception read resolved path
ArmaanMcleod fe29158
Use TestDrive variable
ArmaanMcleod dbb2c76
Adding -LiteralPath parameter
ArmaanMcleod 6501253
Update test name and add another alias test
ArmaanMcleod 7ac8cfd
Setting isLiteralPath to false by default
ArmaanMcleod 1de49ad
Remove JsonFile alias
ArmaanMcleod 6709394
Add error checking for resolved path not being found
ArmaanMcleod 1200d68
Use simpler ItemNotFoundException constructor
ArmaanMcleod 9eb1603
Remove unnecessary exception handling
ArmaanMcleod c7348e6
Check if file exists before reading
ArmaanMcleod 3189ae6
Remove null check since File.Exists can handle null
ArmaanMcleod 64d5c56
Add regions to collapse code parts
ArmaanMcleod dc0dc9b
Updated from feedback
ArmaanMcleod a1e6d79
Undo Codefactor fix for unrelated change
ArmaanMcleod cd3c920
Remove blank line from unrelated codefactor fix
ArmaanMcleod 1114dfd
Exit early with WriteObject with null or whitespace json
ArmaanMcleod c94b462
Remove blank line before else if
ArmaanMcleod File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"JsonPath" is really unfortunate naming as it suggests JSON Path, the query syntax.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gregsdennis Agree, we could change parameter set names to something more suitable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please wait until my #18141 merges, or I can do it afterward. That change almost erased these due to a bad rebase.