Remove-CPCUserSettingsPolicy
SYNOPSIS
Removes a Cloud PC User Settings Policy
SYNTAX
Remove-CPCUserSettingsPolicy [-Name] <String> [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
[<CommonParameters>]
DESCRIPTION
The function will remove a Cloud PC User Settings Policy. The name must match the display name of exactly one policy (exact match, not case sensitive). If no policy or more than one policy has that name, nothing is removed and the command stops. Graph allows more than one User Settings Policy with the same name; rename one of them first if that happens. The function asks for confirmation before it removes the policy. In a non-interactive session (pwsh -File, a pipeline or a scheduled task) the confirmation prompt fails and nothing is removed, so pass -Confirm:$false there.
EXAMPLES
EXAMPLE 1
Remove-CPCUserSettingsPolicy -name "User Settings Policy 01"
EXAMPLE 2
Remove-CPCUserSettingsPolicy -name "User Settings Policy 01" -WhatIf
EXAMPLE 3
Remove-CPCUserSettingsPolicy -name "User Settings Policy 01" -Confirm:$false
Removes the policy without asking for confirmation, as needed in scripts and pipelines.
PARAMETERS
-Name
Enter the name of the Cloud PC User Settings Policy
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by Write-Progress.
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
NOTES
Required permission: CloudPC.ReadWrite.All https://learn.microsoft.com/graph/api/cloudpcusersetting-delete?view=graph-rest-beta https://learn.microsoft.com/graph/api/virtualendpoint-list-usersettings?view=graph-rest-beta