Silk is a PowerShell module for authoring, building, and publishing PowerShell modules and creating a website from a module's help topics.
Silk is a PowerShell module for PowerShell module authors. Use it to:
If you look in Silk's Examples directory, you'll see three scripts that demonstrate its capabilities:
Invoke-Build.ps1shows how to build and package your module with Silk
Publish-Module.ps1shows how to publish your module to Chocolatey, NuGet, and the PowerShell Gallery.
Publish-Website.ps1shows how to publish your module's help to a website.
To get started, create a
build.ps1 file in the root of your
repository. In your
build.ps1 file, import Silk. Use Silk's
Set-ModuleVersion function to set your module's version and
compile any code.
Set-ModuleVersion -ManifestPath "PATH TO MODULE'S *.psd1 FILE" ` -Version "VERSION TO BUILD" ` -ReleaseNotesPath 'PATH TO RELEASE NOTES FILE'
Set-ModuleVersion will also set the version in a .nuspec file (for creating Chocolatey and NuGet packages) and an AssemblyInfo.cs file (for versioning your module's assembly.
Set-ModuleVersion will build a Visual Studio solution if you pass
its path via the
Silk expects your release notes files to be written in Markdown. It
expects each level-1 header (marked with a single
# at the
beginning of a line) to be a version number, and everything after
that header to the next level-1 header (or the end of the file) to
be the release notes for that version. When Set-ModuleVersion sets
the version in a release notes file, it only sets the first level-1
header it finds.
RELEASE_NOTES.md included with the Silk module for an
Silk can do the following actions to prepare your module for a release:
Silk has the following functions you can use to publish/release your module:
Pulish-ChocolateyPackagewill publish your module's .nupkg file to chocolatey.org. (You create a .nupkg file from a .nuspec file with the New-ChocolateyPackage function.
Silk has the following functions for generating a website from a module's help topics. Silk assumes your help is written in Markdown.
Silk will auto-link to commands inside your module. Surround your
module's command names, script names, and about topics in backticks,
and Silk will convert it to a link to that item's help topic. For
example, about_Silk will get converted to
about_help topics, standalone scripts, and commands. The commands are organized into three tabs: one organized by tags, one organized alphabetically by command name, and one organized alphabetically by verb.