-
-
Notifications
You must be signed in to change notification settings - Fork 62
Add Comprehensive Failure Reporting and Enhanced Export Capabilities #82
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
Conversation
…mpliance policies - Introduced new parameters for showing app install summary, compliance policy summary, and configuration policy summary. - Implemented functions to retrieve app install summaries, compliance policy device summaries, and configuration policy device summaries. - Added reporting functions for app install failures, compliance policy failures, and configuration policy failures with a threshold of 60%. - Updated the menu to include options for accessing the new reports. - Enhanced export functionality for the new report types.
…roved user prompts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
This PR introduces comprehensive failure reporting and enhanced export capabilities for Intune assignments, enabling administrators to quickly identify and analyze deployment issues across applications, compliance policies, and configuration policies. The changes also improve cross-platform compatibility with enhanced macOS support.
Key changes include:
- Six new reporting functions for summarizing installation/deployment metrics and identifying failures
- Six new menu options (12-17) providing access to deployment metrics and failure analysis
- Enhanced macOS compatibility with automatic Downloads folder exports
- Parameter mode support for automated reporting without user interaction
IntuneAssignmentChecker.ps1
Outdated
| } | ||
| default { | ||
| Write-Host "Invalid choice, please select 1-11, 98, 99, or 0." -ForegroundColor Red | ||
| Write-Host "Invalid choice, please select 1-17, 98, 99, or 0." -ForegroundColor Red |
Copilot
AI
Aug 4, 2025
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.
The valid menu option range is hardcoded and will need manual updates when new options are added. Consider making this dynamic based on the actual available menu options to reduce maintenance overhead.
| Write-Host "Invalid choice, please select 1-17, 98, 99, or 0." -ForegroundColor Red | |
| Write-Host ("Invalid choice, please select one of: " + ($validMenuOptions -join ', ') + ".") -ForegroundColor Red |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Hello, Hopping in to ask if the main file will be changed soon? Whenever I downloaded from the repository, it has the older version. |
…ve user feedback for invalid menu selections
…ulating failure rates of policy assignments
|
I've addressed both review comments from Copilot: 1. ✅ Removed Duplicate macOS Check (Line 1640)Eliminated the redundant macOS check code block that was duplicating logic from lines 1630-1638. The duplicate block has been removed to improve maintainability and reduce potential for bugs. Before: Two identical 2. ✅ Dynamic Menu Option ValidationImplemented dynamic menu validation using an array of valid options instead of hardcoding the valid range in the error message. Changes:
Before: Write-Host "Invalid choice, please select 1-17, 98, 99, or 0." -ForegroundColor RedAfter: Write-Host ("Invalid choice, please select one of: " + ($validMenuOptions -join ', ') + ".") -ForegroundColor RedBenefits:
|
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
Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| # Note: The Microsoft URI uses "Compliace" (not "Compliance")—this is intentionally matching Microsoft's official endpoint spelling. | ||
| $response = Invoke-MgGraphRequest -Method POST ` | ||
| -Uri "$GraphEndpoint/beta/deviceManagement/reports/microsoft.graph.getDeviceStatusSummaryByCompliacePolicyReport" ` |
Copilot
AI
Oct 11, 2025
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.
Corrected spelling of 'Compliacce' to 'Compliance' in the URI.
| $failureRate = 100 - $_.SuccessRate | ||
| $failureRate -ge $FailureThreshold | ||
| } | ForEach-Object { | ||
| # Add failure rate for easier display | ||
| $_ | Add-Member -MemberType NoteProperty -Name "FailureRate" -Value (100 - $_.SuccessRate) -Force |
Copilot
AI
Oct 11, 2025
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.
Consider using a consistent calculation method across all failure rate calculations. The Get-ConfigurationPolicyFailuresReport calculates failure rate differently than Get-AppInstallFailuresReport which uses the Get-FailureRate function.
| $failureRate = 100 - $_.SuccessRate | |
| $failureRate -ge $FailureThreshold | |
| } | ForEach-Object { | |
| # Add failure rate for easier display | |
| $_ | Add-Member -MemberType NoteProperty -Name "FailureRate" -Value (100 - $_.SuccessRate) -Force | |
| $failureRate = Get-FailureRate $_ | |
| $failureRate -ge $FailureThreshold | |
| } | ForEach-Object { | |
| # Add failure rate for easier display | |
| $_ | Add-Member -MemberType NoteProperty -Name "FailureRate" -Value (Get-FailureRate $_) -Force |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ort for improved performance
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Add Comprehensive Failure Reporting and Enhanced Export Capabilities
Fixes #74
Summary
This PR introduces a comprehensive suite of reporting functions for Intune assignments, enabling administrators to quickly identify and analyze deployment issues across applications, compliance policies, and configuration policies. The changes also improve cross-platform compatibility with enhanced macOS support. When using command-line parameters, all summary reports show data for all items without filtering, while granular filtering by name remains available in interactive mode.
What's Changed
New Reporting Functions
Core Summary Functions
Get-AppsInstallSummaryReport (Lines 1012-1076)
Get-CompliancePolicyDeviceSummaryReport (Lines 1078-1228)
Get-ConfigurationPolicyDeviceSummaryReport (Lines 1230-1509)
Failure Analysis Functions
Get-AppInstallFailuresReport (Lines 1511-1552)
(FailedCount / TotalCount) * 100Get-CompliancePolicyFailuresReport (Lines 1554-1594)
(100 - ComplianceRate)Get-ConfigurationPolicyFailuresReport (Lines 1596-1636)
((NonCompliantCount + ErrorCount) / TotalDevices) * 100📊 New Menu Options
Added six new reporting options to the main menu (Lines 1748-1753):
🎯 Parameter Mode Behavior
When using the script with command-line switches (
-ShowAppInstallSummary,-ShowComplianceSummary,-ShowConfigurationSummary):For granular filtering by specific app or policy names, use the interactive mode (menu-driven interface).
🖥️ Enhanced macOS Compatibility
Updated Export-ResultsIfRequested Function (Lines 1787-1842)
$IsMacOSvariable~/Downloads/IntuneAssignmentChecker_Reports/📁 Export Functionality
All reporting options (12-17) now support CSV export with:
Technical Implementation Details
Key Features of Reporting Functions
Data Processing
Testing Recommendations
Breaking Changes
None - all changes are backward compatible.
Migration Notes
Users on macOS will now see exports saved to their Downloads folder instead of file dialog prompts. The folder location is:
~/Downloads/IntuneAssignmentChecker_Reports/