Skip to content

Add -SkipLimitCheck switch to Import-PowerShellDataFile - #13672

Merged
Rob Holt (rjmholt) merged 6 commits into
PowerShell:masterfrom
SteveL-MSFT:hashtable-limit
Dec 9, 2020
Merged

Rob Holt (rjmholt) merged 6 commits into
PowerShell:masterfrom
SteveL-MSFT:hashtable-limit

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Sep 22, 2020 •

Copy link
Copy Markdown
Member

PR Summary

By default, there is a limit to the number of keys in a hashtable allowed to be converted from a psd1 file (500 keys). This limit is hitting user cases like DSC configuration. Change is to add a -SkipLimitCheck switch to by-pass the validation step for a hashtable.

PR Context

Fix #7979

PR Checklist

@TylerLeonhardt

Copy link
Copy Markdown
Member

Shouldn't this follow the JSON cmdlet's -Depth so it's consistant?

@vexx32

Copy link
Copy Markdown
Collaborator

-Depth is a bit of a different concept than just maximum number of keys/properties.

But I do think following a similar pattern is probably a better call than a switch; if a user knows the ballpark value to use, let them specify 1000 or 2000 so they can keep some control over the input file and verify things aren't getting input over and above what they expected. Have it default to 500 and then if you really want no limit, set it to zero or something?

@rjmholt

Copy link
Copy Markdown
Collaborator

if you really want no limit, set it to zero or something?

0 or -1 both seem logical to me

@SteveL-MSFT Steve Lee (SteveL-MSFT) changed the title Add -NoLimit switch to Import-PowerShellDataFile Add -SkipLimitCheck switch to Import-PowerShellDataFile Sep 23, 2020
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

I think 0 or -1 to mean infinite only makes sense to a developer. Most users don't think like that. Per @PowerShell/powershell-committee updated to -SkipLimitCheck

@rjmholt Rob Holt (rjmholt) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tests LGTM. Small suggestion on the param name

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

The static analysis credscan issue is fixed as part of #13692

@ghost ghost added the Review - Needed The PR is being reviewed label Oct 6, 2020
@ghost

Copy link
Copy Markdown

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@ghost ghost added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Review - Needed The PR is being reviewed labels Nov 4, 2020
@adityapatwardhan

Copy link
Copy Markdown
Member

Steve Lee (@SteveL-MSFT) Please update the PR.

@ghost ghost added the Stale label Nov 28, 2020
@ghost

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.

…hell.Utility.psd1

Co-authored-by: Aditya Patwardhan <adityap@microsoft.com>

@rjmholt Rob Holt (rjmholt) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM with Aditya Patwardhan (@adityapatwardhan)'s suggestion applied

@ghost ghost removed the Stale label Dec 8, 2020
@rjmholt

Copy link
Copy Markdown
Collaborator

PoshChan-Bot (@PoshChan) please remind me in 18 hours

@PoshChan

Copy link
Copy Markdown
Collaborator

Rob Holt (@rjmholt), this is the reminder you requested 18 hours ago

@rjmholt
Rob Holt (rjmholt) merged commit 95ce064 into PowerShell:master Dec 9, 2020
@rjmholt Rob Holt (rjmholt) added CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Dec 9, 2020
@ghost

Copy link
Copy Markdown

🎉v7.2.0-preview.2 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Import-PowerShellDataFile Errors on files over 3230 lines

6 participants