Skip to content

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

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#54
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:26
@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 58 minutes and 3 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: 95fe2e88-577d-4a25-a714-99d1549e7ee5

📥 Commits

Reviewing files that changed from the base of the PR and between 1af7c2c and 5b3ee80.

📒 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
Contributor

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

Tightens argument validation in the repository’s build entrypoint (build.ps1) so invalid task inputs fail during parameter binding rather than producing later psake errors.

Changes:

  • Add [ValidateNotNullOrEmpty()] to the build.ps1 -Task parameter to reject '' and $null inputs early.

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

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