Matt Richardson Matt Richardson May 9, 2019

Expanded Script Modules Support

For a long while now, we've been hearing requests for Script Module support for languages other than PowerShell. We're happy to share this has just shipped in our latest release - 2019.5.0!

For some people, this is awesome news. For others, you're probably asking "What's a Script Module?"

A Script Module is a collection of functions that can be shared across mutiple projects. These can make your life easier by allowing functions to be centrally defined and managed, instead of copying and pasting code between your projects. Find them under Library -> Script Modules.

New C# Script Module

Once you've defined your Script Module, you can use it in your projects. One thing to note is that the new languages require explicit imports; they are not imported automatically as is the case with PowerShell Script Modules. This has the benefit of making the script module dependency more explicit and prevents naming collisions and unexpected behavior.

In the case of C#, this is achieved by a #load <scriptmodulefilename.csx> call at the top of the script:

New C# Script Module

The help text above the body of your Script Module will show the exact syntax you need.

Usage

Another great feature we're proud to talk about is Script Module usage. We've surfaced where your Script Module has been used, so that it's easy to see what projects might be impacted by your changes. This will mean less suprises during your deployments, which is always a great thing. We now show which projects and releases have references:

Script Module Usages

We've also got plans to show this usage on Variable Sets very soon. Stay tuned!

Take a look at the Script Modules documentation for a walkthrough and examples for each language.

Happy deployments!

Product

Welcome! We use cookies and data about how you use our website allow us to improve the website and your experience, and resolve technical errors. Our website uses cookies and shares some of your data with third party analytics companies for these purposes. We do not use these cookies for advertising.

If you decline, we will respect your privacy. A single cookie will be used in your browser to remember your preference.