Rename-RMCollection
From PowerGUI Wiki
Renames a computer collection.
Contents |
Syntax
Rename-RMCollection [-Name] <String> [-NewName] <String> [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Rename-RMCollection [-InputObject] <ComputerCollection> [-NewName] <String> [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Detailed Description
Renames a computer collection with the name you specify.
Related Commands
Parameters
| Name | Description | Required? | Pipeline Input | Default Value |
|---|---|---|---|---|
| Name | Specifies the name of the computer collection to be renamed. | true | true (ByValue, ByPropertyName) | |
| NewName | Specifies a new name for the computer collection | true | true (ByPropertyName) | |
| PassThru | Passes the renamed collection along the pipeline. If this parameter is omitted, the renamed collection is not passed along the pipeline. | false | false | |
| WhatIf | Describes what would happen if you executed the command without actually executing the command. | false | false | |
| Confirm | Prompts for a confirmation before executing the command. | false | false | |
| InputObject | Renames the computer collection represented by the specified collection objects. Specify the name of the variable that contains the objects or type a command or expression that gets the objects. | true | true (ByValue) |
Examples
Example 1
Rename-RMCollection -Name "New Computer Collection" -NewName Collection1
This command renames the computer collection named "New Computer Collection" to "Collection1".
Example 2
$c = Get-RMCollection –Name "Collection1" C:\PS>Rename-RMCollection -InputObject $c –NewName "Collection2"
The Get-RMCollection cmdlet retrieves the computer collection named Collection1. This collection is then passed to the Rename-RMCollection cmdlet that renames it to Collection2.
