How to publish powershell module to powershellgallery
First you need to have a powershell module, refer to here for module creation.
Secondly create an API key at default powershell module registery https://www.powershellgallery.com/account/apikeys, you can find it with following powershell command
Get-PSRepository
lastly publish it
Publish-Module -Path “<PATH-TO-FILE>” -Repository <PS-REPOSITORY-NAME> -NuGetApiKey “<USER>:<API-KEY>”
Publish-Module -Name .\Scripts\k8s -Repository PSGallery -NuGetApiKey "YourAPIKey"
sample of installation:
Install-Module k8s
Get-InstalledModule
Get All command in this module and help document
Get-Command -Module k8s
kcurrent -?