Get-Help equivalent for DSC resources

Welcome Forums DSC (Desired State Configuration) Get-Help equivalent for DSC resources

This topic contains 2 replies, has 2 voices, and was last updated by

3 years, 1 month ago.

  • Author
  • #31694

    Points: 0
    Rank: Member

    Hi, I'm trying to understand how to explore what is available for DSC resources. What I mean by that is if I'm in the PowerShell console and I want to do something with a service and I don't know what is available I just type "Get-Help *service* and I get a nice list of all the CmdLets with service in the name. Oh, I want to call "Get-Service", what does that take? Let me type "Get-Help Get-Service -Full". Boom, everything I could possibly want to know about every parameter, types, and examples. There's even a nice link to the online version.

    Enter DSC. I want to create a configuration script that makes sure service XYZ is there. I happen to know there is a MS provided Service resource but other than that, no ideas on what parameters it takes. How/Where do I figure that out? What I love about PS is how easy the help system is. I have no clue how to do this for the DSC resources. I've just started looking into DSC so I've probably just missed it, but I sure hope there is a way to figure this out.

  • #31777

    Points: 70
    Rank: Member

    Hi Bart,

    Closest thing to help is the syntax/and or some explanations on Github.

    PS C:\WINDOWS\system32> Get-DscResource -Syntax file
    File [String] #ResourceName
    DestinationPath = [string]
    [Attributes = [string[]]{ Archive | Hidden | ReadOnly | System }]
    [Checksum = [string]{ CreatedDate | ModifiedDate | SHA-1 | SHA-256 | SHA-512 }]
    [Contents = [string]]
    [Credential = [PSCredential]]
    [DependsOn = [string[]]]
    [Ensure = [string]{ Absent | Present }]
    [Force = [bool]]
    [MatchSource = [bool]]
    [PsDscRunAsCredential = [PSCredential]]
    [Recurse = [bool]]
    [SourcePath = [string]]
    [Type = [string]{ Directory | File }]

  • #31778

    Points: 70
    Rank: Member

    Also check out–8672
    By Snover and Helmick. It then leads onto the advanced stuff. Then check out Jones' dsc recource vids on the mva site.

The topic ‘Get-Help equivalent for DSC resources’ is closed to new replies.