GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add `-SkipLimitCheck` switch to `Import-PowerShellDataFile` by SteveL-MSFT · Pull Request #13672 · PowerShell/PowerShell

Conversation

@SteveL-MSFT

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

Uh oh!

There was an error while loading. Please reload this page.

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

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
  • This PR is ready to merge and is not Work in Progress.
    • If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.
  • Breaking changes
    • None
    • OR
    • Experimental feature(s) needed
      • Experimental feature name(s): Microsoft.PowerShell.Utility.PSImportPSDataFileNoLimit
  • User-facing changes
    • Not Applicable
    • OR
    • Documentation needed
      • Issue filed:
  • Testing - New and feature
    • N/A or can only be tested interactively
    • OR
    • Make sure you've added a new test if existing tests do not effectively test the code changed
  • Tooling
    • I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
    • OR
    • I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include:
      • Impact on PowerShell Editor Services which is used in the PowerShell extension for VSCode (which runs in a different PS Host).
      • Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
      • Impact on PSScriptAnalyzer (which provides linting & formatting in the editor extensions).
      • Impact on EditorSyntax (which provides syntax highlighting with in VSCode, GitHub, and many other editors).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@SteveL-MSFT
Steve Lee (SteveL-MSFT) requested review from TylerLeonhardt, Dongbo Wang (daxian-dbw) and Rob Holt (rjmholt) September 22, 2020 13:58
@ghost ghost assigned Aditya Patwardhan (adityapatwardhan) Sep 22, 2020
@SteveL-MSFT
Steve Lee (SteveL-MSFT) force-pushed the hashtable-limit branch from 7dda6b9 to 38e86f1 Compare September 22, 2020 14:03
@TylerLeonhardt

TylerLeonhardt commented Sep 22, 2020

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vexx32

Rain Sallow (/u/ta11ow) (vexx32) commented Sep 22, 2020

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?

TylerLeonhardt reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rjmholt

Rob Holt (rjmholt) commented Sep 22, 2020

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

vexx32 and TylerLeonhardt reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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

Steve Lee (SteveL-MSFT) commented Sep 23, 2020

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 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rjmholt
Rob Holt (rjmholt) approved these changes Sep 24, 2020
View reviewed changes

@rjmholt Rob Holt (rjmholt) left a comment

Copy link
Copy Markdown
Collaborator

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.

Tests LGTM. Small suggestion on the param name

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/System.Management.Automation/engine/parser/ast.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

rjmholt
Rob Holt (rjmholt) approved these changes Sep 24, 2020
View reviewed changes
@SteveL-MSFT

Steve Lee (SteveL-MSFT) commented Sep 25, 2020

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Steve Lee (SteveL-MSFT) added 5 commits September 28, 2020 10:53
@SteveL-MSFT
Add -NoLimit switch to Import-PowerShellDataFile
c55d026
@SteveL-MSFT
Fix codeFactor issues
a8d3d41
@SteveL-MSFT
Rename -NoLimit to -SkipLimitCheck
b01834b
@SteveL-MSFT
Fix test where switch name changed
1138e49
@SteveL-MSFT
address Rob's feedback to rename the parameter (and enum value)
197ffa1
@SteveL-MSFT
Steve Lee (SteveL-MSFT) force-pushed the hashtable-limit branch from a918136 to 197ffa1 Compare September 28, 2020 17:53
@ghost ghost added the Review - Needed The PR is being reviewed label Oct 6, 2020
@ghost

Deleted user (ghost) commented Oct 6, 2020

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

adityapatwardhan
Aditya Patwardhan (adityapatwardhan) previously requested changes Nov 4, 2020
View reviewed changes
Comment thread src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

@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

Aditya Patwardhan (adityapatwardhan) commented Nov 13, 2020

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Deleted user (ghost) commented Nov 28, 2020

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rjmholt @adityapatwardhan
Update src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerS…
fbdd823
…hell.Utility.psd1

Co-authored-by: Aditya Patwardhan <[email protected]>
rjmholt
Rob Holt (rjmholt) approved these changes Dec 8, 2020
View reviewed changes

@rjmholt Rob Holt (rjmholt) left a comment

Copy link
Copy Markdown
Collaborator

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.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ghost ghost removed the Stale label Dec 8, 2020
@rjmholt Rob Holt (rjmholt) assigned Rob Holt (rjmholt) and unassigned Aditya Patwardhan (adityapatwardhan) Dec 8, 2020
@rjmholt

Rob Holt (rjmholt) commented Dec 8, 2020

Copy link
Copy Markdown
Collaborator

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

PoshChan reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PoshChan

PoshChan-Bot (PoshChan) commented Dec 9, 2020

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rjmholt
Rob Holt (rjmholt) requested a review from Aditya Patwardhan (adityapatwardhan) December 9, 2020 19:05
@rjmholt
Rob Holt (rjmholt) dismissed Aditya Patwardhan (adityapatwardhan)’s stale review December 9, 2020 19:06

Requested changes have been made

@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

Deleted user (ghost) commented Dec 15, 2020

Copy link
Copy Markdown

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

Handy links:

  • Release Notes
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ghost ghost mentioned this pull request Dec 15, 2020
Import-PowerShellDataFile Errors on files over 3230 lines #7979
Closed
@sdwheeler Sean Wheeler (sdwheeler) mentioned this pull request Jan 25, 2021
Add -SkipLimitCheck switch to Import-PowerShellDataFile MicrosoftDocs/PowerShell-Docs#7170
Closed
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
@SteveL-MSFT
Add -SkipLimitCheck switch to Import-PowerShellDataFile (PowerShe…
2056949
…ll#13672)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@daxian-dbw Dongbo Wang (daxian-dbw) Awaiting requested review from daxian-dbw daxian-dbw is a code owner
@TylerLeonhardt TylerLeonhardt Awaiting requested review from TylerLeonhardt
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) Awaiting requested review from adityapatwardhan
1 more reviewer
@rjmholt Rob Holt (rjmholt) rjmholt approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@rjmholt Rob Holt (rjmholt)

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Import-PowerShellDataFile Errors on files over 3230 lines

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@SteveL-MSFT @TylerLeonhardt @vexx32 @rjmholt @adityapatwardhan @PoshChan
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.