Rename-CMCategory

Renames a category.

Syntax

Rename-CMCategory
      -CategoryType <CategoryType>
      [-Confirm]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      -Name <String>
      -NewName <String>
      [-PassThru]
      [-WhatIf]
      [<CommonParameters>]
Rename-CMCategory [-Confirm] [-DisableWildcardHandling] [-ForceWildcardHandling] -InputObject 
 -NewName  [-PassThru] [-WhatIf] []

Description

The Rename-CMCategory cmdlet renames a category instance.

Examples

Example 1: Rename a category by getting a category object

PS ABC:\> $Category = Get-CMCategory -Name "Category01" -CategoryType BaselineCategories
PS ABC:\> Rename-CMCategory -InputObject $Category -NewName "NewCategory01"

The first command gets the category object named Category01 of the type BaselineCategories and stores the object in the $Category variable.

The second command renames the category stored in $Category to NewCategory01.

Example 2: Rename a category by its name and type

PS ABC:\> Rename-CMCategory -Name "Category02" -NewName "NewCategory02" -CategoryType BaselineCategories

This command renames the category named Category02 of the type BaseineCategories to NewCategory02.

Example 3: Rename a category by passing a category object through the pipeline

PS ABC:\> Get-CMCategory -Name "Category03" -CategoryType BaselineCategories | Rename-CMCategory -NewName "NewCategory03"

This command gets the category object named Category03 of the type BaselineCategories and uses the pipeline operator to pass the object to Rename-CMCategory, which renames the category to NewCategory03.

Required Parameters

-CategoryType

Specifies a category type. Valid values are:- AppCategories

  • BaselineCategories
  • CatalogCategories
  • DriverCategories
  • UserCategories
Type:CategoryType
Parameter Sets:AppCategories, BaselineCategories, CatalogCategories, DriverCategories, UserCategories
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies a category instance object. To obtain a category instance object, use the Get-CMCategory cmdlet.

Type:IResultObject
Aliases:Category
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of a category instance.

Type:String
Aliases:LocalizedCategoryInstanceName, CategoryName
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NewName

Specifies a new name for the category instance.

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

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

Indicates that wildcard handling is disabled.

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

Indicates that wildcard handling is enabled.

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

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Type:SwitchParameter
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 is not run.

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