Remove-SCHardwareProfile

Removes a hardware profile object from the VMM library.

Syntax

Remove-SCHardwareProfile
      [-HardwareProfile] <HardwareProfile>
      [-RunAsynchronously]
      [-PROTipID <Guid>]
      [-JobVariable <String>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-SCHardwareProfile cmdlet removes one or more hardware profile objects from the VMM library.

This cmdlet returns the object upon success with the MarkedForDeletion property set to $True, or returns an error message upon failure.

Examples

Example 1: Remove a specific hardware profile from the library

PS C:\> $HWProfile = Get-SCHardwareProfile | where { $_.Name -eq "NewHWProfile01"}
PS C:\> Remove-SCHardwareProfile -HardwareProfile $HWProfile -Confirm

The first command gets the hardware profile object named NewHWProfile01 from the VMM library and stores the object in the $HWProfile variable.

The second command deletes NewHWProfle01 from the library, prompting the user for confirmation before completing the operation.

Example 2: Remove all hardware profiles without being prompted to confirm each deletion

PS C:\> Get-SCHardwareProfile | Remove-SCHardwareProfile

This command gets all hardware profile objects in the library and passes each profile object to the Remove-SCHardwareProfile cmdlet, which removes each hardware profile. By not using the Confirm parameter, you are not prompted to confirm whether to delete these hardware profile objects.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-HardwareProfile

Specifies a hardware profile object.

Type:HardwareProfile
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

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

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

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

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Notes

  • Requires a VMM hardware profile object, which can be retrieved by using the Get-SCHardwareProfile cmdlet.