KB0036 - How to set the license via environment variable

KB0036 - How to set the license via environment variable

Purpose

The purpose of this article is to explain how to set the license for PowerShell Universal by way of environment variable instead of the traditional file-based method.

Scope

For now, only Windows is in the scope of this article. Linux and MacOs will be added in the near future.

Background

This approach can be desirable in certain scenarios (e.g. Azure DevOps pipelines).

Procedure

1. If there is an instance of PowerShell Universal already installed, remove its license from the console (or Remove-PSULicense) and then stop the instance service.
2. Set the environment variable (at the machine level) to PSULICENSE as the entire content of your license data. It should start with the < character per image below. There are a number of ways to set the environment variable.



3. At this point I would actually restart the system just to be safe.
4. If stopped, start the PowerShell Universal instance and logon to confirm the license status.

Verification

For logged confirmation that the procedure is working, set the logging to Debug level and restart the PowerShell Universal instance. Observe the log entry in below image: "Loading license information."



    • Related Articles

    • KB0048 - License is about to expire

      Scope This article only applies to PowerShell Universal instances with a perpetual license (monthly licenses excluded). See https://ironmansoftware.com/license/info for more information about PowerShell Universal licensing. Problem Your PowerShell ...
    • KB0011 - Are licenses different between Production, QA and Test/Development servers?

      Update January 24th, 2023 Adam recently summarized the Developer's license per below: The only real limitation on the developer license is that it cannot be accessed remotely. The server is only available on loopback when using the dev license. If ...
    • PowerShell Universal Service crashes on startup after an upgrade to 1.4.6

      Version: PowerShell Universal 1.4.6 Issue The PowerShell Universal service will crash with the following error in Event Viewer.  Application: Universal.Server.exe CoreCLR Version: 4.700.19.56402 .NET Core Version: 3.1.0 Description: The process was ...
    • KB0069 - PowerShell Universal Startup Process

      Purpose The purpose of this document is to outline the steps that PowerShell Universal takes when starting up. Process 1. Insert current product version and install date in database Updates the database with a record about the current product version ...
    • KB0074 - Connecting to PSU API w/Windows Auth

      Scope This article applies only to PSU environments where Windows Authentication[1] is enabled and known to be working[2]. Problem You are not able to interact with the PSU instance using the Invoke-WebRequest PowerShell cmdlet even though logging in ...