PublishModule.ps1

Echo "Publishing NCache PowerShell Module to PowerShell Gallery"

# --- CONFIG ---
$NCachePowershellModuleName = "Az.NCache"
$NuGetAPIKey = "oy2mbncabtmzknehjedanh5ahodc6xoergtihw4rz4td7q" 

# Force TLS 1.2 for Gallery
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12

# --- PUBLISH MODULE ---
$VerbosePreference = "Continue"
Write-Verbose "Publishing module $NCachePowershellModuleName from current folder to PSGallery..."

Publish-Module -Repository PSGallery -Path (Get-Location).Path -NuGetApiKey $NuGetAPIKey -Force -Verbose

Echo "✅ NCache PowerShell module successfully published"