Ubuntu VS code extension connection issues with PSU

I have been trying for hours to install psud (Ubuntu) vs code extension, but I keep receiving the same error when it attempts to connect:

PowerShell Universal requires the Microsoft PowerShell or PowerShell Preview extension.

and also this:

Error running command powershell-universal.refreshEndpointTreeView: command 'powershell-universal.refreshEndpointTreeView' not found. This is likely caused by the extension that contributes powershell-universal.refreshEndpointTreeView.

I’ve tried installing PSUD on the host machine using wget, import module normal and community versions as well as in docker and as a dockerfile. In all cases PSUD installs successfully, but i just can’t seem to connect to the vs code extension.

At first I thought maybe it was a port issue since I wanted to change the port from 5000 to 9000 (5000) is in use. But even trying the default 5000 gives the same error.

In each case i generated a token and updated the vs code settings with the token. I tried restarted both vs code and PSUD. I even purchased the PSUD license to see if maybe I needed it to generate the proper tokens…

I’m not sure if i have the wrong vs code extension or if I’m not configuring something right. Any help would be appreciated. Thanks!

Ok so problem solved. The issue was that I needed another extension installed in vscode as the first error suggested. Since PowerShell Preview is deprecated, I needed to Install the powershell extension that says microsoft. So as a noob I didn’t realize this and thought all i needed was for powershell to be installed on the OS but vscode requires it’s own powershell environment possible to execute the scripts associated with the API for PSUD extension?

So first, install PSUD (doesn’t matter how, you can even use docker), then install the powershell (microsoft) extension, then go into the PSUD dashboard and navigate to settings, configurations and select the “edit with vscode” button. Then and only then can you successfully install powershell universal extension in vscode.

If you install the powershell universal extension before doing the other stuff, you’ll have problems. I didn’t have to do anything manual but if you still have issues, you can configure the PSU extension manually by generating a token in PSUD dashboard then pasting it in the PSU extension settings. Also make sure the url is correct.

Final thoughts as a noob.

Because I’m not as experienced, I had trouble when it came to assigning the correct ports because PSUD uses port 5000 by default. If you change the port, you may have to configure the extension manually.

1 Like