Skip to content

Get-MgmtGraphDeviceCategoryDetail

MgmtGraph: Lists Intune device categories for selection

#Requires -Version 5.1
#Requires -Modules Microsoft.Graph.DeviceManagement

[CmdletBinding()]
Param ()

Process {
    try {
        $categories = Get-MgDeviceManagementDeviceCategory -All -ErrorAction Stop
        
        $results = foreach ($c in $categories) {
            [PSCustomObject]@{
                DisplayName = $c.DisplayName
                Id          = $c.Id
                Timestamp   = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
            }
        }

        Write-Output ($results | Sort-Object DisplayName)
    }
    catch {
        throw
    }
}

This script has no configurable parameters.

An interactive directory of PowerShell scripts.