Skip to content

Latest commit

 

History

History
184 lines (132 loc) · 4.32 KB

File metadata and controls

184 lines (132 loc) · 4.32 KB
external help file Module Name ms.date schema title
AdminUI.PS.dll-Help.xml
ConfigurationManager
12/28/2021
2.0.0
Remove-CMScript

Remove-CMScript

SYNOPSIS

Remove a PowerShell script from Configuration Manager.

SYNTAX

SearchByValueMandatory (Default)

Remove-CMScript [-Force] -InputObject <IResultObject> [-DisableWildcardHandling] [-ForceWildcardHandling]
 [-WhatIf] [-Confirm] [<CommonParameters>]

SearchByNameMandatory

Remove-CMScript [-Force] -ScriptName <String> [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf]
 [-Confirm] [<CommonParameters>]

DESCRIPTION

Use this cmdlet to remove a PowerShell script from Configuration Manager. These scripts are integrated and managed in Configuration Manager. When you remove a script, it you can't run it anymore. Instead of removing a script, you can also deny it so it can't run on clients. For more information, see Deny-CMScript.

For more general information, see Create and run PowerShell scripts from the Configuration Manager console.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

EXAMPLES

Example 1: Remove a script by using the script name

This command removes a script that has the name getUesrs.

Remove-CMScript -ScriptName "getUsers" -Force

PARAMETERS

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Force

Forces the command to run without asking for user confirmation.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-InputObject

Specify a script object to remove. To get this object, use the Get-CMScript cmdlet.

Type: IResultObject
Parameter Sets: SearchByValueMandatory
Aliases: Script

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ScriptName

Specify the name of the script to remove.

Type: String
Parameter Sets: SearchByNameMandatory
Aliases: Name

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

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

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

OUTPUTS

System.Object

NOTES

RELATED LINKS

Approve-CMScript Deny-CMScript Get-CMScript Invoke-CMScript New-CMScript Set-CMScript

Create and run PowerShell scripts from the Configuration Manager console