I want to centrally manage and maintain all PowerShell code used in Octopus across all projects and steps.
At first I looked at using the Script Modules under Library, but unfortunately it does not have package support only inline code!?
I want the code to be source controlled where TeamCity will publish the package to the Octopus package repository - this model offers most benefits like change control, auditing, history, versioning etc.
I have already created PowerShell module that holds all code used in Octopus and I am using it from deployment steps like this:
I import the module in each step via the bootstrap-module.ps1 and then use the Script Parameters field to call a module member function. Obviously this is a hack and ideally I would like to use it like shared across projects module but there is no support for packaging - are there any plans to introduce this feature?
Feel free to add extra comments to the user voice idea or comment on the blog post mentioned, we are listening and haven’t given up on source control integration.