Installing extension in VSCode and separated PSUniversal installs

Product: PowerShell Universal
Version: ?

I just tried to install the extension in VSCode to have it configured and install PSU automatically.
It just keeps trying to be busy or something but I see no progression or end to it.
I have had it running for 1 hour now and no results, just the panels having that bleu stripe going left and right.

Do I need to do something extra here?

Another question I had: with Universal Dashboard you could all UD script/module files in 1 location/folder and have the module be imported form that location. In this way I could have 2 or 3 folders, each with it’s own UD files. So let’s say version 2.4 in one, version 2.5 in another, and so forth.
Is the same setup possible with PSU?

It seems like it’s failing to connect to the PSU server. If you navigate to localhost:5000 in the browser is the server running? If it is, i would login with admin\any password and check the Settings \ Security \ AppTokens page. Make sure a toke has been created. Then in VS Code, you can validate that that token has been set correctly on the settings for the PowerShell Universal extension.

You can configure PSU with your own file and folder structure by using single-file hosting and configuration: Single-File - PowerShell Universal (ironmansoftware.com)

I made a video about it too: PowerShell Universal: Single-File Hosting and Configuration - YouTube

Hi Adam,

Thanks for the Single-File hosting, I will look int that.

Every time I start VSCode I can go the the PSU icon on the left and click it and get the same message:


I click the Download button and the same thing happens, I keep waiting.
I tried to access “http://localhost:5000/” but nothing happens, I get the message " This site can’t be reached".

Regards,
Steven

Hmmm definitely failing to download for some reason. It should be trying to access this file: Download (windows.net)

We’ll have to take a look at the extension to see if something is wrong there (or at least provide some sort of feedback when this fails). In the mean time, you can manually download the server from the downloads page: Downloads – Ironman Software

The Universal VS Code extension will attempt to connect on localhost:5000 by default. This can be configured in the settings.

Hi Adam,

Hmmm definitely failing to download for some reason. It should be trying to access this file: Download (windows.net)

Perhaps that is the issue? I am on MacOS (Catalina 10.15.7) and either the code makes the assumption to apply the Windows package or the decision tree does not include the possibility of MacOS and runs around in circles? Just wildly throwing unfounded suggestions at you :slight_smile:

I downloaded the “Mac OSX ZIP” file (Universal.osx-x64.1.5.3.zip) and unpacked it.
Do I need to run a script to install it or just copy that folder to a location of my choosing?
And then do an import module of “Universal.psm1” and then I can create Dashboards?

Perhaps I need to read some more on the V3/Universal way of working :slight_smile:

Regards,
Steven

Whoops. Didn’t realize you were on Mac. It should be downloading the Mac version.

Here’s the JS that’s doing it to give you an idea: universal-code/downloadUniversal.ts at master · ironmansoftware/universal-code (github.com)

You can just unzip the server and run it from where ever. Just run Universal.Server. You might need to chmod +x it in your environment.

If you install the Universal module, you can import the module and start building dashboards.

Install-Module Universal
Start-PSUServer -Port 8080 -Configuration {
 # Dashboard code in here
} -ExecutablePath "PathToUniversalServer"

Here’s a full example of a dashboard:

Active Directory - PowerShell Universal (ironmansoftware.com)

I think moving forward we will have the extension just use the PowerShell module rather than doing all this itself. Then it could just call Install-PSUServer and Start-PSUServer and we don’t need to implement that in both PowerShell and JavaScript.

Hi Adam,

I had a quick look and I am no Java expert and it looked logical. The part where the platform is found might be different on Java but compared with PowerShell you get something different:

$PSVersionTable.Platform
Answer : Unix

The check has “linux” to test for inux OS and for MacOS it uses “darwin”.
Perhaps os.platform() does not return the right value?
Although there is an alarm that would be raised in the switch to handle that, so there’s that.

Thanks for the example and explanation of how to run Universal server!

Regards,
Steven