external help file | Locale | Module Name | ms.date | online version | schema | title |
---|---|---|---|---|---|---|
PSDesiredStateConfiguration-help.xml |
en-US |
PSDesiredStateConfiguration |
03/22/2022 |
2.0.0 |
Get-DscResource |
Gets Desired State Configuration (DSC) resources present on the computer.
Get-DscResource [[-Name] <String[]>] [[-Module] <Object>] [-Syntax] [<CommonParameters>]
The Get-DscResource
cmdlet retrieves the PowerShell DSC resources present on the computer. This
cmdlet discovers only the resources installed in the PSModulePath. It shows the details about
built-in and custom providers, which are created by the user. This cmdlet also shows details about
composite resources, which are other configurations that are packaged as module or created at run
time in the session.
Get-DscResource
This command gets all the resources on the local computer.
Get-DscResource -Name "WindowsFeature"
This command gets the WindowsFeature resource.
Get-DscResource -Module "xHyper-V"
This command gets all the resources from the xHyper-V module.
Get-DscResource -Name P*,r*
This command gets all resources that match the wildcard pattern specified by the Name parameter.
Get-DscResource -Name "WindowsFeature" -Syntax
This command gets the WindowsFeature resource, and shows the syntax for the resource.
Get-DscResource -Name "User" | Select-Object -ExpandProperty Properties
This command gets the User resource, and then uses the pipeline operator to return all the properties for the User resource.
Get-DscResource -Module @{ModuleName='xHyper-V';RequiredVersion='3.0.0.0'}
This command gets all the resources from xHyper-V module with version 3.0.0.0.
Specifies the name or fully qualified name of the module for which to view the DSC resource.
Type: System.Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Specifies an array of names of the DSC resource to view.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Indicates that the cmdlet returns the syntax view of the specified DSC resources. The returned syntax shows how to use the resources in a PowerShell script.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.