Conversation
- Add CmdletBinding(SupportsShouldProcess) to Update-SKUPropertySet, Set-ColumnColor, New-Worksheet, Set-SvcAvailReportObj - Fix cost date range from 1 day to 30 days in Invoke-CostReportSchedule - Guard Get-MeterId call against null costDetails
…r internal helpers
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates several PowerShell scripts to address PSScriptAnalyzer ShouldProcess guidance, improve cmdlet-style declarations, and fix/adjust cost-reporting behavior.
Changes:
- Added
[CmdletBinding()]/ suppression attributes (and an[OutputType]) to reporting helper functions in7-Report/Get-Report.ps1. - Adjusted cost report date range to 30 days and guarded meter ID extraction when cost details are missing in
1-Collect/Get-AzureServices.ps1. - Added
SupportsShouldProcesstoUpdate-SKUPropertySetin2-AvailabilityCheck/Get-AvailabilityInformation.ps1.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| 7-Report/Get-Report.ps1 | Adds cmdlet-binding metadata and suppresses PSSA ShouldProcess warnings for report-related helper functions. |
| 2-AvailabilityCheck/Get-AvailabilityInformation.ps1 | Adds SupportsShouldProcess to a state-mutating helper used during SKU availability mapping. |
| 1-Collect/Get-AzureServices.ps1 | Expands the cost report window and prevents meter ID lookups when cost details are unavailable. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Removed CmdletBinding attribute from Update-SKUPropertySet function.
Removed SuppressMessage attribute and CmdletBinding from Set-ColumnColor function.
Removed unnecessary attributes from New-Worksheet function.
Removed unnecessary SuppressMessageAttribute and CmdletBinding from Set-SvcAvailReportObj function.
jfaurskov
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces several improvements and bug fixes across multiple PowerShell scripts, focusing on enhancing parameter validation, improving commandlet behavior, and correcting logic for cost reporting.
Enhancements to Cmdlet Declarations and Suppression Attributes:
[CmdletBinding()]and suppression attributes toSet-ColumnColor,New-Worksheet, andSet-SvcAvailReportObjin7-Report/Get-Report.ps1to improve cmdlet consistency and suppress warnings aboutShouldProcessusage. [1] [2] [3]Cost Reporting and Logic Fixes:
Invoke-CostReportScheduleto provide a broader cost analysis.Get-AzureServices.ps1by ensuring meter IDs are only retrieved when both$includeCostis true and$costDetailsis not null, preventing errors when cost details are missing.Improvements to Availability Check Cmdlets:
[CmdletBinding(SupportsShouldProcess)]toUpdate-SKUPropertySetin2-AvailabilityCheck/Get-AvailabilityInformation.ps1to align with best practices for state-changing functions.