How to publish a Powershell Module to PowershellGallery with Appveyor?

225 views Asked by At

Is there a way to add a custom powershell script into the appveyor build script to publish a module to powershellgallery? - The module source would be in the github repo.

If not, maybe it's possible within the appveyor web config itself?

1

There are 1 answers

0
Ilya Finkelsheyn On BEST ANSWER

I believe you can create script based Publish-Module command and insert it into right stage of build pipeline. For example if you decide to publish after test stage, it will look like this in YAML: after_test: - ps: Publish-Module -Name "MyDscModule" -NuGetApiKey "11e4b435-6cb4-4bf7-8611-5162ed75eb73"

Or in UI you need to go to Settings > Test > Auto > After tests script > PS and enter publish script.