external help file | Module Name | ms.date | schema | title |
---|---|---|---|---|
AdminUI.PS.dll-Help.xml |
ConfigurationManager |
12/28/2021 |
2.0.0 |
Remove-CMScript |
Remove a PowerShell script from Configuration Manager.
Remove-CMScript [-Force] -InputObject <IResultObject> [-DisableWildcardHandling] [-ForceWildcardHandling]
[-WhatIf] [-Confirm] [<CommonParameters>]
Remove-CMScript [-Force] -ScriptName <String> [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf]
[-Confirm] [<CommonParameters>]
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.
This command removes a script that has the name getUesrs.
Remove-CMScript -ScriptName "getUsers" -Force
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
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
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
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
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
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
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
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Approve-CMScript Deny-CMScript Get-CMScript Invoke-CMScript New-CMScript Set-CMScript
Create and run PowerShell scripts from the Configuration Manager console