Skip to main content
Version: 2.0.0

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.

INPUTS

OUTPUTS

System.Boolean

NOTES