How to use PowerShell script modules... on Linux
Blog post from Octopus Deploy
Octopus Deploy facilitates the use of reusable PowerShell script modules for deployments across projects, enhancing automation on both Windows and Linux systems, although the latter requires additional steps for integration. Despite the fact that PowerShell script modules automatically become available on Windows, they do not on Linux, prompting the need for a workaround to achieve similar functionality. The solution involves retrieving the contents of a script module, saving them to a file, and then importing them into a PowerShell script within a bash script. This method is exemplified using a script module called "Say Hello," which demonstrates how to execute PowerShell commands on Linux, ensuring that users can effectively reuse their library of PowerShell scripts across different operating systems.