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:
- New-Item -ItemType Directory C:\PSUData\PSU1
 
- New-Item -ItemType Directory C:\PSUData\PSU2
3. Copy the appsettings.json file from the application directory to the data directories.
- Copy-Item C:\PSU\appsettings.json C:\PSUData\PSU1
 
- Copy-Item C:\PSU\appsettings.json C:\PSUData\PSU2
4. Adjust the paths in the appsettings.json file to be unique to each instance. 
- {
 
-     "SystemLogPath": "C:\\PSUData\\PSU1\\systemLog.txt",    
-     "Data": {
-         "RepositoryPath": "C:\\PSUData\\PSU1\\Repository",
-         "ConnectionString": "filename=C:\\PSUData\\PSU1\\database.db;upgrade=true",
 
-      }
 
- }
5. Adjust the Kestrel port to be unique for each instance. 
- {
-   "Kestrel": {
-     "Endpoints": {
-       "HTTP": {
-         "Url": "http://*:5555"
-       }
-     },
 
- }
6. Create the services and specify the appropriate appsettings.json files. 
- New-Service -Name PSU1 -BinaryPathName "C:\PSU\Universal.Server.exe --service --appsettings C:\PSUData\PSU1\appsettings.json"
 
- New-Service -Name PSU2 -BinaryPathName "C:\PSU\Universal.Server.exe --service --appsettings C:\PSUData\PSU2\appsettings.json"
7. Start the services. 
- Start-Service PSU1
 
- 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 ...