Skip to content

v2.2.0 - Scheduling, Activation Profiles, Reduced Scope, Policy Cache & General enhancements #16

v2.2.0 - Scheduling, Activation Profiles, Reduced Scope, Policy Cache & General enhancements

v2.2.0 - Scheduling, Activation Profiles, Reduced Scope, Policy Cache & General enhancements #16

name: Publish to PowerShell Gallery
on:
release:
types: [published]
workflow_dispatch: # Allow manual trigger
permissions:
contents: read
jobs:
publish:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install required modules
shell: pwsh
run: |
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
# Install compatible versions to avoid known compatibility issues
# Microsoft.Graph 2.29.1 + Az.Accounts 5.1.0 is a tested working combination
Install-Module -Name Microsoft.Graph.Authentication -RequiredVersion 2.29.1 -Force -AllowClobber
Install-Module -Name Microsoft.Graph.Users -RequiredVersion 2.29.1 -Force -AllowClobber
Install-Module -Name Microsoft.Graph.Identity.DirectoryManagement -RequiredVersion 2.29.1 -Force -AllowClobber
Install-Module -Name Microsoft.Graph.Identity.Governance -RequiredVersion 2.29.1 -Force -AllowClobber
Install-Module -Name Az.Accounts -RequiredVersion 5.1.0 -Force -AllowClobber
- name: Test module manifest
shell: pwsh
run: |
Test-ModuleManifest -Path ./PIMActivation.psd1
- name: Publish to PSGallery
shell: pwsh
env:
NUGET_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
run: |
Publish-Module -Path . -NuGetApiKey $env:NUGET_API_KEY -Verbose