Upravit

Sdílet prostřednictvím


Set-CMFolder

Configure a folder in the console.

Syntax

Set-CMFolder
   -Name <String>
   [-ParentContainerNode <IResultObject>]
   [-ParentFolderPath <String>]
   [-NewName <String>]
   [-MoveToPath <String>]
   [-MoveToFolder <IResultObject>]
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMFolder
   -Id <Int32>
   [-NewName <String>]
   [-MoveToPath <String>]
   [-MoveToFolder <IResultObject>]
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMFolder
   -Guid <Guid>
   [-NewName <String>]
   [-MoveToPath <String>]
   [-MoveToFolder <IResultObject>]
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMFolder
   -FolderPath <String>
   [-NewName <String>]
   [-MoveToPath <String>]
   [-MoveToFolder <IResultObject>]
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMFolder
   -InputObject <IResultObject>
   [-NewName <String>]
   [-MoveToPath <String>]
   [-MoveToFolder <IResultObject>]
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Use this cmdlet to configure the specified folder. For example, rename it or move it to another folder.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1

$parentPath = 'DeviceCollection'
$name =  'Folder1'
$name2 =  'Folder2'
$name3 =  'Folder3'
$root = New-CMFolder -ParentFolderPath $parentPath -Name $name
Set-CMFolder -Name $name2 -ParentContainerNode (Get-CMFolder -Name $name) -NewName $newName

Example 2

(Get-CMFolder -Name $newName) | Set-CMFolder -NewName $name2

Example 3

$folder = Set-CMFolder -Name $name3 -ParentFolderPath ($parentPath + '\' + $name + '\' + $name2) -MoveToFolder $root

Example 4

$folder = Set-CMFolder -Guid $sub2.FolderGuid -MoveToPath ($parentPath + '\' + $name + '\' + $name2)

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

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

-FolderPath

Specify the path to the console folder. For example, DeviceCollection\Folder1

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

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

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

-Guid

Specify the GUID of the console folder to configure.

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

-Id

Specify the ID of the console folder to configure.

Type:Int32
Aliases:ContainerNodeID
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Specify a folder object to configure. To get this object, use the Get-CMFolder cmdlet.

Type:IResultObject
Aliases:ContainerNode
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-MoveToFolder

To move a folder, specify the target folder object. To get this object, use the Get-CMFolder cmdlet.

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

-MoveToPath

To move a folder, specify the path to the target folder.

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

-Name

Specify the name of the console folder to configure.

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

-NewName

Use this parameter to rename the folder.

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

-ParentContainerNode

Specify a folder object for the parent container. To get this object, use the Get-CMFolder cmdlet.

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

-ParentFolderPath

Specify the path of the parent folder.

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

-PassThru

Add this parameter to return an object that represents the item with which you're working. By default, this cmdlet may not generate any output.

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 doesn't run.

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

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object