How do I use Install-Package inside a DSC configuration pull?

This topic contains 4 replies, has 2 voices, and was last updated by Profile photo of TyMac711 TyMac711 4 months, 3 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #38197
    Profile photo of TyMac711
    TyMac711
    Participant

    I would like to have a DSC config that check to see if a package like xFirefox is installed and if not it installs it. Google keeps sending me in circles on this so I was hoping somebody here could point to an example configuration..

    #38198
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    The DSC resources in https://github.com/PowerShell/PackageManagementProviderResource might be what you're looking for. Or if you want a Chocolatey package, perhaps https://github.com/PowerShellOrg/cChoco .

    #38380
    Profile photo of TyMac711
    TyMac711
    Participant

    Thanks Dave 🙂 I am trying the Choco route and found an article with a DSC config in it:

    https://github.com/Azure/azure-content/blob/master/articles/automation/automation-dsc-cd-chocolatey.md

    Trying this however I get squiggley lines under:
    Import-DscResource -ModuleName cChcoco

    I downloaded cChoco-master.zip from:
    https://github.com/PowerShellOrg/cChoco – then I renamed it cChoco_2.0.5.22.zip,

    moved it to:
    C:\Program Files\WindowsPowerShell\DscService\Modules

    ...and finally created a new-dscchecksum for it. Not sure what I'm missing since the Powershell ISE obviously does not see it. Any suggestions?

    #38382
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    The ISE needs the module to just be installed on your system (somewhere in $env:PSModulePath). The zip / checksum thing is for a pull server; clients that are configured to use that pull server to obtain resources will download and install modules from there, but that doesn't affect the machine where you're authoring the config.

    #38453
    Profile photo of TyMac711
    TyMac711
    Participant

    Ah ok thanks! Not keeping track of my modules lol!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.