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 — fix(repository:) Add input validation for `GetOperation` by Gijsreyn · Pull Request #2002 · PowerShell/PSResourceGet

Conversation

@Gijsreyn

@Gijsreyn Gijs Reijn (Gijsreyn) commented May 24, 2026

Copy link
Copy Markdown
Contributor

PR Summary

This pull request adds a simple input validation when it's empty for the GetOperation on the Repository resource.

PR Context

When --input is omitted, DSC closes the child process stdin without writing anything. The
resource manifest uses "input": "stdin" and invokes the script as $Input | ./psresourceget.ps1 ..., so $Input is an empty enumerator and the $stdinput pipeline parameter is never bound (keeping it $null).

Fixes #2001

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
    • Documentation needed
      • Issue filed:
  • 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.

Sorry, something went wrong.

Uh oh!

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

All reactions
@Gijsreyn
fix(Repository:) Add input validation for GetOperation
7000fd8
Copilot AI review requested due to automatic review settings May 24, 2026 07:08
@Gijsreyn
Gijs Reijn (Gijsreyn) requested review from Sydney Smith (SydneyhSmith), Aditya Patwardhan (adityapatwardhan), alerickson, Anam Navied (anamnavi) and shammu1 as code owners May 24, 2026 07:08
@Gijsreyn Gijs Reijn (Gijsreyn) changed the title fix(Repository:) Add input validation for GetOperation fix(repository:) Add input validation for GetOperation May 24, 2026
Copilot AI reviewed May 24, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds explicit handling for resource get when no --input/stdin is provided, preventing PowerShell parameter-binding errors and returning a clean non-zero exit code.

Changes:

  • Add an early validation in GetOperation to fail fast when no input is provided.
  • Add a CI test ensuring resource get without --input exits non-zero and avoids an unhandled exception.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/DscResource/PSResourceGetDSCResource.Tests.ps1 Adds a regression test for resource get without input to ensure clean failure behavior.
src/dsc/psresourceget.ps1 Adds a guard clause to reject missing stdin/--input before attempting JSON parsing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/dsc/psresourceget.ps1 Resolved

Uh oh!

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

Comment thread test/DscResource/PSResourceGetDSCResource.Tests.ps1 Resolved

Uh oh!

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

@Gijsreyn
Update test
9d06224
@SydneyhSmith Sydney Smith (SydneyhSmith) assigned Aditya Patwardhan (adityapatwardhan) Aug 4, 2026
adityapatwardhan
Aditya Patwardhan (adityapatwardhan) approved these changes Sep 9, 2026
View reviewed changes
@adityapatwardhan

Aditya Patwardhan (adityapatwardhan) commented Sep 10, 2026

Copy link
Copy Markdown
Member

Gijs Reijn (@Gijsreyn) - test failures, can you have a look - https://dev.azure.com/powershell/PowerShellGet/_build/results?buildId=183070&view=logs&j=d2cc1069-8995-5415-ebd3-58917cc8c7fa&t=5108698c-ab69-53eb-f1a9-964b4b2de0df&l=167

https://github.com/PowerShell/PSResourceGet/pull/2028/checks?check_run_id=102931074724

All reactions

Sorry, something went wrong.

Uh oh!

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

Gijs Reijn (Gijsreyn) added 3 commits September 11, 2026 06:01
@Gijsreyn
Dispose lock
cdc55ff
@Gijsreyn
Merge branch 'master' of https://github.com/Gijsreyn/PSResourceGet into
8077b66
PowerShellgh-2001/main/fix-unhandled-null
@Gijsreyn
Fix test
ad7023f
@adityapatwardhan

Aditya Patwardhan (adityapatwardhan) commented Sep 14, 2026

Copy link
Copy Markdown
Member

Test run completed here - #2028

All reactions

Sorry, something went wrong.

Uh oh!

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

adityapatwardhan
Aditya Patwardhan (adityapatwardhan) approved these changes Sep 14, 2026
View reviewed changes
@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit 2cc11ce into PowerShell:master Sep 14, 2026
14 checks passed

Uh oh!

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

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

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) adityapatwardhan approved these changes
@anamnavi Anam Navied (anamnavi) Awaiting requested review from anamnavi anamnavi is a code owner
@alerickson alerickson Awaiting requested review from alerickson alerickson is a code owner
@SydneyhSmith Sydney Smith (SydneyhSmith) Awaiting requested review from SydneyhSmith SydneyhSmith is a code owner
@shammu1 shammu1 Awaiting requested review from shammu1 shammu1 is a code owner

Uh oh!

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

Assignees

@adityapatwardhan Aditya Patwardhan (adityapatwardhan)

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

get without --input crashes with unhandled null pipeline exception on Repository

Uh oh!

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

3 participants

@Gijsreyn @adityapatwardhan
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.