Skip to content

Commit

Permalink
Merge pull request #161 from michaeltlombardi/gh-64/main/about_puppet…
Browse files Browse the repository at this point in the history
…izing_custom_modules

(GH-64) Add docs for customizing private modules
  • Loading branch information
david22swan authored Jun 1, 2021
2 parents e10cfc8 + 6bf1943 commit 432274e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import
.vagrant/
*Results.xml
Puppet.Dsc/
docs/
!docs/about*
docs/*
!docs/about_*
26 changes: 26 additions & 0 deletions docs/about_Puppetizing_Custom_Modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Puppetizing Custom Modules

## about_Puppetizing_Custom_Modules

# SHORT DESCRIPTION

Explanation of when & how to use `puppet.dsc` to convert private/internal PowerShell modules into Puppet modules.

# LONG DESCRIPTION

Sometimes you may want to puppetize a PowerShell module with DSC Resources which is _not_ published to the [Public PowerShell Gallery](https://www.powershellgallery.com/) - for any reason, but often because the resources include business-specific logic.

Luckily, `Puppet.Dsc` makes no distinction between PowerShell modules with DSC Resources which are public and private; you just need to tell it _where_ to find the modules to Puppetize.

The `New-PuppetDscModule` function is able to transparently use any valid PSRepository feed to retrieve PowerShell modules with DSC Resources:

```powershell
# To puppetize from an alternate PSRepository feed
# Make sure to replace 'MyRepository' with your repository name
New-PuppetDscModule -PowerShellModuleName PowerShellGet -PowerShellModuleVersion 2.2.3 -Repository MyRepository
```

If you don't already have a private PSRepository feed, you can [add one](https://docs.microsoft.com/en-us/powershell/scripting/gallery/how-to/working-with-local-psrepositories?view=powershell-7.1) via the Microsoft docs.
You can even [register a PSRepository for a local or shared folder](https://docs.microsoft.com/en-us/powershell/scripting/gallery/how-to/working-with-local-psrepositories?view=powershell-7.1#registering-a-local-repository)!

Once you have the repository added, you need to remember to specify the `Repository` parameter when calling `New-PuppetDscModule` - otherwise it will default to the [Public PowerShell Gallery](https://www.powershellgallery.com/).

0 comments on commit 432274e

Please sign in to comment.