KB0060 - Running Side-By-Side PowerShell Universal Instances

KB0060 - Running Side-By-Side PowerShell Universal Instances

Purpose

The purpose of this document is to outline how to run side-by-side instances of PowerShell Universal on the same machine. These instances will have their own configuration settings and port. This can be useful for testing between versions. 

Scope

- PowerShell Universal v3 and v4
- Microsoft Windows 

Steps

1. Download the PowerShell Universal ZIP archive and extract to a location on your machine (such as C:\PSU). 
2. Create a configuration directory for each PSU instance. For example:
  1. New-Item -ItemType Directory C:\PSUData\PSU1
  2. New-Item -ItemType Directory C:\PSUData\PSU2
3. Copy the appsettings.json file from the application directory to the data directories.
  1. Copy-Item C:\PSU\appsettings.json C:\PSUData\PSU1
  2. Copy-Item C:\PSU\appsettings.json C:\PSUData\PSU2
4. Adjust the paths in the appsettings.json file to be unique to each instance. 
  1. {
  2.     "SystemLogPath": "C:\\PSUData\\PSU1\\systemLog.txt",    
  3.     "Data": {
  4.         "RepositoryPath": "C:\\PSUData\\PSU1\\Repository",
  5.         "ConnectionString": "filename=C:\\PSUData\\PSU1\\database.db;upgrade=true",
  6.      }
  7. }
5. Adjust the Kestrel port to be unique for each instance. 
  1. {
  2.   "Kestrel": {
  3.     "Endpoints": {
  4.       "HTTP": {
  5.         "Url": "http://*:5555"
  6.       }
  7.     },
  8. }
6. Create the services and specify the appropriate appsettings.json files. 
  1. New-Service -Name PSU1 -BinaryPathName "C:\PSU\Universal.Server.exe --service --appsettings C:\PSUData\PSU1\appsettings.json"
  2. New-Service -Name PSU2 -BinaryPathName "C:\PSU\Universal.Server.exe --service --appsettings C:\PSUData\PSU2\appsettings.json"
7. Start the services. 
  1. Start-Service PSU1
  2. Start-Serivce PSU2
You will now be able to navigate to two independent PSU services on the same machine. 
    • Related Articles

    • 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 ...
    • KB0066 - Get-WMIObject cmdlet not working

      Scope This article applies to any scenario where the Get-WMIObject cmdlet is expected to be available and functioning within a PowerShell Universal instance. Effectively, this article will only apply to instances that run under the Windows operating ...
    • 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 ...
    • 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 ...