Environments module
Module: businessdev.ALbuild.Environments • Tier: Licensed • Cmdlets: 4
The Environments module provisions and tears down demo/dev environments and cleans up expired ones. This is a licensed feature.
Licensing
Cmdlets in this module are part of a licensed tier and call Assert-ALbuildLicensed on entry. Without a valid ALbuild license they fail with clear remediation guidance. See Licensing & tiers.
Cmdlets in this module
| Cmdlet | Description |
|---|---|
Get-BcEnvironment | Lists ALbuild-provisioned Business Central environments (containers). |
New-BcEnvironment | Provisions a demo or developer Business Central environment (container) with Traefik routing (licensed). |
Remove-BcEnvironment | Removes an ALbuild Business Central environment and its Traefik configuration (licensed). |
Remove-BcExpiredEnvironment | Removes all expired ALbuild Business Central environments (licensed). |
Get-BcEnvironment
Lists ALbuild-provisioned Business Central environments (containers).
Returns the containers tagged as ALbuild environments, with their metadata labels (type, owner, public URL, expiry) and whether they have expired.
Syntax
Code
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
-Name | String | No | Optional exact environment name filter. |
-DockerExecutable | String | No | The Docker executable to use (default 'docker'). Default: 'docker'. |
Output
PSCustomObject with Name, Type, Owner, Url, ExpiresAt, Expired, Running.
New-BcEnvironment
Provisions a demo or developer Business Central environment (container) with Traefik routing (licensed).
Creates a Business Central container tagged with environment metadata labels (expiry, owner, type) for label-based lifecycle management, and produces a Traefik v3 dynamic configuration routing to it (Subdomain or PathPrefix). Requires Windows + Docker and a valid ALbuild license.
Syntax
Code
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
-Name | String | Yes | Environment / container name. |
-Domain | String | Yes | Base domain for Traefik routing (e.g. businesscentral.example.com). |
-Credential | PSCredential | Yes | Container admin credential. |
-ArtifactUrl | String | No | The BC artifact URL. If omitted, resolved from -Type/-Country/-Version. |
-Type | String | No | Artifact type when resolving: Sandbox (default) or OnPrem. Allowed values: Sandbox, OnPrem. Default: 'Sandbox'. |
-Country | String | No | Artifact country. Default 'w1'. Default: 'w1'. |
-Version | String | No | Optional artifact version. |
-Routing | String | No | Traefik routing mode: Subdomain (default) or PathPrefix. Allowed values: Subdomain, PathPrefix. Default: 'Subdomain'. |
-EnvironmentType | String | No | Demo (default) or Development. Allowed values: Demo, Development. Default: 'Demo'. |
-ExpiresInDays | Int32 | No | Lifetime in days (used for the expiry label). Default 7. Default: 7. |
-OwnerEmail | String | No | Owner email recorded as a label. |
-TraefikConfigFolder | String | No | Folder to write the Traefik dynamic configuration to. Default: ./traefik. Default: (Join-Path (Get-Location) 'traefik'). |
-DockerExecutable | String | No | The Docker executable to use (default 'docker'). Default: 'docker'. |
Output
PSCustomObject describing the environment (Name, Url, ExpiresAt, Container, TraefikConfig).
Remove-BcEnvironment
Removes an ALbuild Business Central environment and its Traefik configuration (licensed).
Syntax
Code
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
-Name | String | Yes | Environment / container name. |
-TraefikConfigFolder | String | No | Folder containing the environment's Traefik dynamic config (<Name>.json) to delete. |
-DockerExecutable | String | No | The Docker executable to use (default 'docker'). No ConfirmImpact='High': ALbuild runs primarily non-interactively, where a High-impact prompt has no host UI and ShouldProcess throws a NullReferenceException. -WhatIf/-Confirm remain available. Default: 'docker'. |
Remove-BcExpiredEnvironment
Removes all expired ALbuild Business Central environments (licensed).
Finds ALbuild environments whose expiry has passed and removes them (and their Traefik configuration). Intended to be run on a schedule.
Syntax
Code
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
-TraefikConfigFolder | String | No | Folder containing the environments' Traefik dynamic configs to delete. |
-DockerExecutable | String | No | The Docker executable to use (default 'docker'). Default: 'docker'. |
Output
The names of the removed environments.


