Skip to content

Publish PowerShell Module to PowerShellGallery

Actions
A GitHub Action to Publish a PowerShell module
v0.0.1.0
Latest
Star (1)

Publish PowerShell Module GitHub Action

This action Publishes a PowerShell module.

Inputs

ModuleName

Required The name of the PowerShell module.

Source

Optional The source directory containing the module (relative to the workspace).

Output

Optional TThe output directory for storing the module (relative to the workspace).

ApiKey

Required The PowerShell Gallery API Key.

Debug

Optional Enable debug mode. The default is `false``.

Example usage

name: Build PowerShell Module

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  build:
    runs-on: windows-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          path: 'Repo'

      - name: Create PowerShell Manifest
        uses: mod-posh/CreatePowerShellManifest@v0.0.1.0
        with:
          ModuleName: 'SpnLibrary'
          Source: 'Repo'
          Imports: 'public'
          Debug: 'true'

      - name: Create PowerShell Module
        uses: mod-posh/CreatePowerShellModule@v0.0.1.0
        with:
          ModuleName: 'SpnLibrary'
          Source: 'Repo'
          Imports: 'public'
          Debug: 'true'

      - name: Test PowerShell Module
        uses: mod-posh/TestPowerShellModule@v0.0.1.0
        with:
          ModuleName: 'SpnLibrary'
          Source: 'Repo'
          Debug: 'true'

      - name: Publish PowerShell Module
        uses: mod-posh/PublishPowerShellModule@v0.0.1.0
        with:
          ModuleName: 'SpnLibrary'
          Source: 'Repo'
          ApiKey: ${{ secrets.APIKEY }}
          Debug: 'true'

Publish PowerShell Module to PowerShellGallery is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

A GitHub Action to Publish a PowerShell module
v0.0.1.0
Latest

Publish PowerShell Module to PowerShellGallery is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.