Remove-SCSMClassInstance
Remove-SCSMClassInstance
Permanently removes a class instance.
Syntax
Parameter Set: Default
Remove-SCSMClassInstance [-Instance] <EnterpriseManagementInstance[]> [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Remove-SCSMClassInstance cmdlet permanently removes a class instance.
Parameters
-Instance<EnterpriseManagementInstance[]>
Specifies an instance of a configuration item object to be removed.
You can specify an EnterpriseManagementObject that is returned by the Get-SCClassInstance cmdlet.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Microsoft.EnterpriseManagement.Core.Cmdlets.Instances.EnterpriseManagementInstance
You can pipe a class instance to the Instance parameter of the Remove-SCSMClassInstance cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
None.
This cmdlet does not generate any output.
Examples
Example 1
The commands in the following example remove all class instances, of type System.Windows.Computer, whose first letter of the instance class begins with the upper case letter āCā.
PS C:\>$cmp = Get-SCSMClass -name Microsoft.Windows.Computer
PS C:\>Get-SCSMClassInstance -class $cmp|format-Table PrincipalName,DisplayName
PS C:\>Get-SCSMClassInstance -class $cmp -Filter 'DisplayName -like "C%"'
PS C:\>Get-SCSMClassInstance -class $cmp -Filter 'DisplayName -like "Computer1%"' | Remove-SCSMClassInstance
PS C:\>Get-SCSMClassInstance -class $cmp|format-Table PrincipalName,DisplayName