Skip to content

style: add ValidateNotNullOrEmpty to build.ps1 -Task parameter#17

Merged
tablackburn merged 1 commit into
mainfrom
style/validate-task-not-null-or-empty
May 12, 2026
Merged

style: add ValidateNotNullOrEmpty to build.ps1 -Task parameter#17
tablackburn merged 1 commit into
mainfrom
style/validate-task-not-null-or-empty

Conversation

@tablackburn
Copy link
Copy Markdown
Owner

Summary

Adds [ValidateNotNullOrEmpty()] to the $Task parameter in build.ps1 to match the canonical pattern from PowerShellModuleTemplate#23.

Without the validator, ./build.ps1 -Task '' and ./build.ps1 -Task $null` slip past parameter binding and produce confusing downstream errors from psake. The validator surfaces the misuse immediately.

Test plan

  • ./build.ps1 still runs successfully (default 'default' task)
  • ./build.ps1 -Task '' fails fast with a parameter-validation error

🤖 Generated with Claude Code

Matches the canonical template (PowerShellModuleTemplate#23). Without
the validator, `./build.ps1 -Task ''` and `./build.ps1 -Task $null` slip
past parameter binding and produce confusing downstream errors from
psake. The validator surfaces the misuse immediately.
Copilot AI review requested due to automatic review settings May 12, 2026 02:27
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Warning

Rate limit exceeded

@tablackburn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 57 minutes and 30 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ed1c3fe6-1d17-4b2d-9d67-e032bdb7e3a0

📥 Commits

Reviewing files that changed from the base of the PR and between 566b548 and d133621.

📒 Files selected for processing (1)
  • build.ps1
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch style/validate-task-not-null-or-empty

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds early parameter validation to build.ps1 so invalid -Task values fail fast during parameter binding instead of producing downstream psake errors.

Changes:

  • Added [ValidateNotNullOrEmpty()] to the -Task parameter in build.ps1.

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tablackburn tablackburn merged commit a0611f7 into main May 12, 2026
16 checks passed
@tablackburn tablackburn deleted the style/validate-task-not-null-or-empty branch May 12, 2026 02:32
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