-
Notifications
You must be signed in to change notification settings - Fork 0
Investigation: Scripted alerts already support multiple input parameters #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
- Updated Get-CIPPAlertExpiringLicenses to accept direct parameters (ExpiringLicensesDays, ExpiringLicensesUnassignedOnly) - Updated Get-CIPPAlertSharepointQuota to accept PercentageThreshold parameter - Updated Get-CIPPAlertQuotaUsed to accept PercentageThreshold parameter - Updated Get-CIPPAlertEntraConnectSyncStatus to accept Hours parameter - Updated Get-CIPPAlertHuntressRogueApps to accept IgnoreDisabledApps parameter - Updated Get-CIPPAlertIntunePolicyConflicts to accept all configuration parameters directly - Maintained backward compatibility with InputValue parameter - Added comprehensive tests demonstrating both InputValue and direct parameter usage - Direct parameters take priority over InputValue properties for flexibility Co-authored-by: Zacgoose <107489668+Zacgoose@users.noreply.github.com>
- Created comprehensive documentation explaining the new capability - Documented all updated alert functions and their parameters - Provided usage examples for both old and new methods - Verified end-to-end parameter flow works correctly Co-authored-by: Zacgoose <107489668+Zacgoose@users.noreply.github.com>
- Properly added Hours parameter to function signature - Fixed parameter handling logic to check PSBoundParameters - Ensured HoursThreshold variable is correctly set from Hours or InputValue - Addresses code review findings Co-authored-by: Zacgoose <107489668+Zacgoose@users.noreply.github.com>
|
@copilot ther eis no need to update the tests, no need to make documentation and no need to add explicid params where its already handled by $input |
Per feedback, the system already handles multiple inputs through $input parameter. Reverted: - All alert function explicit parameter additions - Test modifications - Documentation No explicit params needed where already handled by $input. Co-authored-by: Zacgoose <107489668+Zacgoose@users.noreply.github.com>
Reverted all changes in commit d88e019. The explicit parameters, tests, and documentation have been removed as the system already handles multiple inputs through the $input parameter. |
This PR documents the investigation into supporting multiple input parameters for scripted alerts.
Findings
The system already supports passing multiple input parameters through the existing
$inputparameter mechanism in alert functions. No code changes were needed.Original Approach (Reverted)
Initially attempted to add explicit typed parameters to alert functions, but this was unnecessary as:
$inputparameter (aliased fromInputValue) already handles multiple configuration values as properties of an objectPush-ExecScheduledCommand.ps1(lines 152-165) already supports passing any parameters through PowerShell's parameter discovery and splatting$inputparameterCurrent Usage
Multiple input parameters are already supported by passing them as properties in the
$inputobject:The timer infrastructure (
Push-ExecScheduledCommand.ps1) converts parameters from JSON and splats them to alert functions, which can access multiple configuration values through the$inputparameter.Conclusion
No changes required - the functionality already exists in the current implementation.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.