Powershell bzlmod extensions

Module Extensions

powershell

powershell = use_extension("@rules_powershell//powershell:extensions.bzl", "powershell")
powershell.toolchain(name, urls, version)

Bzlmod extensions for Powershell

TAG CLASSES

toolchain

An extension for defining a pwsh_toolchain from a download archive.

rules_powershell declares and registers a default hub named powershell_toolchains for all consumers, so no setup is required to get started. To use a different version of Powershell, declare a hub with a unique name and register it. Toolchains registered by the root module take precedence over the default. If two modules declare a hub with the same name, the root module's declaration wins.

An example of defining and registering toolchains:

powershell = use_extension("@rules_powershell//powershell:extensions.bzl", "powershell")
powershell.toolchain(
    name = "powershell_7_5_3",
    version = "7.5.3",
)
use_repo(powershell, "powershell_7_5_3")

register_toolchains(
    "@powershell_7_5_3//:all",
)

Attributes

NameDescriptionTypeMandatoryDefault
nameThe name of the toolchain hub repository.Namerequired
urlsUrl templates to use for downloading Powershell.List of stringsoptional["https://github.com/PowerShell/PowerShell/releases/download/v{semver}/{artifact}"]
versionThe version of Powershell to download.Stringoptional"7.5.4"