Test-MdePolicyHasAssignment
SYNOPSISโ
Checks if a configuration policy is assigned to any groups or devices
SYNTAXโ
Test-MdePolicyHasAssignment [-PolicyId] <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTIONโ
Returns true if the policy has active assignments (not just exclusions). This helps ensure we only test policies that are actually deployed.
EXAMPLESโ
EXAMPLE 1โ
Test-MdePolicyHasAssignment -PolicyId "abc-123"
Returns $true if policy is assigned to groups or devices.
PARAMETERSโ
-PolicyIdโ
The ID of the configuration policy to check
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressActionโ
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParametersโ
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.