Skip to content

Get ClassBasedResourceName

gaelcolas edited this page Jul 18, 2024 · 1 revision

Get-ClassBasedResourceName

SYNOPSIS

Get the Names of the Class-based DSC Resources defined in a file using AST.

SYNTAX

Get-ClassBasedResourceName [-Path] <String> [<CommonParameters>]

DESCRIPTION

This command returns all Class-based Resource Names in a file, by parsing the file and looking for classes with the [DscResource()] attribute.

For MOF-based DSC Resources, look at the Get-MofSchemaName function.

EXAMPLES

EXAMPLE 1

Get-ClassBasedResourceName -Path source/Classes/MyDscResource.ps1

Get-ClassBasedResourceName -Path (Join-Path -Path (Get-Module MyResourceModule).ModuleBase -ChildPath (Get-Module MyResourceModule).RootModule)

PARAMETERS

-Path

Path of the file to parse and search the Class-Based DSC Resources.

Type: String
Parameter Sets: (All)
Aliases: FilePath

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

OUTPUTS

System.String[]

NOTES

RELATED LINKS

Clone this wiki locally