Edit

Share via


Get-CMFolder

Get one or more folders in the console.

Syntax

SearchByName (Default)

Get-CMFolder
    [[-Name] <String>]
    [-InputObject <IResultObject>]
    [-ParentFolderPath <String>]
    [-TypeName <String>]
    [-IsEmpty <Boolean>]
    [-IsSearchFolder <Boolean>]
    [-SiteCode <String>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

SearchByIdMandatory

Get-CMFolder
    -Id <Int32>
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

SearchByGuidMandatory

Get-CMFolder
    -Guid <Guid>
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

SearchByPathMandatory

Get-CMFolder
    -FolderPath <String>
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

Description

Use this cmdlet to get all customized folders or folders from the specified parent path.

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
$folder = Get-CMFolder -FolderPath ($parentPath + '\' + $name + '\' + $name2 + '\' +$name3)

Parameters

-DisableWildcardHandling

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FolderPath

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SearchByPathMandatory
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ForceWildcardHandling

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Guid

Specify the GUID of the console folder.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False
Aliases:FolderGuid

Parameter sets

SearchByGuidMandatory
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

Specify the ID of the console folder.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ContainerNodeID

Parameter sets

SearchByIdMandatory
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Specify a folder object for the parent container.

Parameter properties

Type:IResultObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ParentContainerNode

Parameter sets

SearchByName
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-IsEmpty

Set this parameter to $true to filter the results by empty folders.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SearchByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IsSearchFolder

Set this parameter to $true to filter the results by search folders.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SearchByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specify the name of the console folder.

Parameter properties

Type:String
Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

SearchByName
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ParentFolderPath

Specify the path of the parent folder.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SearchByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SiteCode

Specify the three-character code for the site.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SourceSite

Parameter sets

SearchByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TypeName

Specify the type to filter the results. For example:

  • SMS_Collection_Device
  • SMS_Package
  • SMS_Driver

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ObjectTypeName

Parameter sets

SearchByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

IResultObject

IResultObject

Notes

For more information on this return object and its properties, see SMS_ObjectContainerNode server WMI class.