Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,22 @@ What actually happened (error message, wrong output, or no output).

## Environment

- **PowerShell version:** (e.g. output of `$PSVersionTable.PSVersion`)
- **PowerShell version:** (output of `$PSVersionTable.PSVersion` — must be 7.0 or higher)
- **PowerShell host:** Are you running `pwsh` (PowerShell 7) or `powershell.exe` (Windows PowerShell 5.1)?
- **OS:** (e.g. Windows 11, macOS 14, Ubuntu 22.04)
- **Module version:** (e.g. output of `Get-Module RKSolutions | Select-Object Version`)
- **Module version:** (output of `Get-Module RKSolutions | Select-Object Version`)

## Installation & Import

- **How did you install the module?**
- [ ] PowerShell Gallery (`Install-Module -Name RKSolutions`)
- [ ] GitHub (cloned/downloaded and `Import-Module ./module/RKSolutions.psd1`)

- **Does the module load correctly?**
Run `Get-Command -Module RKSolutions` and paste the output:
```powershell
# Paste output here
```

## Additional context

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RK-Solutions-PSModule/

## Prerequisites

- **PowerShell 5.1+** or **PowerShell 7+** (cross-platform)
- **PowerShell 7.0 or higher** (Windows, macOS, Linux)
- **Microsoft.Graph.Authentication** (and other Graph modules as required by the cmdlets)
- **Microsoft Graph permissions:** App registration in Azure AD / Entra ID with the scopes required by the cmdlets you use. See **[Graph permissions (full list)](docs/PERMISSIONS.md)** for a per-cmdlet breakdown.

Expand Down
6 changes: 3 additions & 3 deletions module/Private/IntuneAnomalies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2240,13 +2240,13 @@ function Get-AllDeviceData {
Write-Host "Fetching Autopilot devices..." -ForegroundColor Yellow
$AutopilotDevices = (Invoke-GraphRequestWithPaging -Uri "https://graph.microsoft.com/beta/deviceManagement/windowsAutopilotDeviceIdentities")

# Pre-build Autopilot lookup hashtable (serialNumber device object) for O(1) lookups
# Pre-build Autopilot lookup hashtable (serialNumber -> device object) for O(1) lookups
$AutopilotLookup = @{}
foreach ($ap in $AutopilotDevices) {
if ($ap.serialNumber) { $AutopilotLookup[$ap.serialNumber] = $ap }
}

# Pre-build user lookup hashtable (id UPN) for O(1) lookups
# Pre-build user lookup hashtable (id -> UPN) for O(1) lookups
$UserLookup = @{}
foreach ($u in $AllEntraIDUsers) {
if ($u.id -and $u.userPrincipalName) { $UserLookup[$u.id] = $u.userPrincipalName }
Expand All @@ -2269,7 +2269,7 @@ function Get-AllDeviceData {
Write-Progress -Activity "Processing Intune Devices" -Status "Processing device: $($DeviceData.DeviceName)" -CurrentOperation "$currentIndex of $totalDevices devices processed" -PercentComplete $progressPercent

try {
# Use bulk-fetched data directly (no per-device re-fetch needed same $select)
# Use bulk-fetched data directly (no per-device re-fetch needed - same $select)
$DeviceProperties = $DeviceData

# Process Autopilot information via pre-built hashtable
Expand Down
136 changes: 68 additions & 68 deletions module/Private/IntuneEnrollmentFlows.ps1

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This is the script implementation of the RKSolutions module. It provides cmdlets to connect to Microsoft Graph and generate reports for Intune Enrollment Flows, Intune Anomalies, Entra Admin Roles, and M365 License Assignment.

> **Requires PowerShell 7.0 or higher.** Windows PowerShell 5.1 is not supported.

## Module structure

```
Expand Down
9 changes: 6 additions & 3 deletions module/RKSolutions.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = 'RKSolutions.psm1'
ModuleVersion = '1.0.0'
ModuleVersion = '1.0.1'
GUID = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
Author = 'Roy Klooster'
CompanyName = 'RK Solutions'
Expand All @@ -23,8 +23,11 @@
PSData = @{
Tags = @('RKSolutions', 'Microsoft365', 'MicrosoftIntune', 'MicrosoftEntraID', 'MicrosoftGraph', 'DeviceManagement', 'Reporting')
LicenseUri = 'https://opensource.org/licenses/MIT'
ProjectUri = 'https://www.powershellgallery.com'
ReleaseNotes = '1.0.0 - Initial module release. Consolidates Generate-IntuneEnrollmentFlowsReport, Generate-IntuneAnomaliesReport, Generate-EntraAdminRolesReport, and Generate-M365LicenseAssignmentReport scripts into a single module with shared auth, export, and email helpers.'
ProjectUri = 'https://github.com/royklo/RKSolutions-Module'
ReleaseNotes = @'
1.0.1 - Requires PowerShell 7.0 or higher. Fixed encoding issues for Windows compatibility. Improved error messaging when running on unsupported PowerShell versions.
1.0.0 - Initial module release. Consolidates Intune Enrollment Flows, Intune Anomalies, Entra Admin Roles, and M365 License Assignment reports into a single module.
'@
}
}
}
18 changes: 18 additions & 0 deletions module/RKSolutions.psm1
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# RKSolutions.psm1 - Dot-source Private then Public; export only public functions
# Private scripts (e.g. IntuneEnrollmentFlows.ps1) may define helper functions (e.g. Get-DeviceEvaluationContext,
# Get-CloudPCProvisioningPolicyGroupInfo) that are used internally by Public cmdlets but are NOT exported as cmdlets.

# Require PowerShell 7.0 or higher
if ($PSVersionTable.PSVersion.Major -lt 7) {
Write-Host ""
Write-Host "RKSolutions module requires PowerShell 7.0 or higher." -ForegroundColor Red
Write-Host "Current version: $($PSVersionTable.PSVersion)" -ForegroundColor Red
Write-Host ""
Write-Host "You are running Windows PowerShell (powershell.exe)." -ForegroundColor Yellow
Write-Host "Please use PowerShell 7 (pwsh.exe) instead." -ForegroundColor Yellow
Write-Host ""
Write-Host "Install PowerShell 7: " -ForegroundColor White -NoNewline
Write-Host "https://aka.ms/powershell" -ForegroundColor Cyan
Write-Host "After installing, run: " -ForegroundColor White -NoNewline
Write-Host "pwsh" -ForegroundColor Green
Write-Host ""
exit 1
}

$moduleRoot = $PSScriptRoot

# Load Private scripts first (shared helpers, then report-specific)
Expand Down