VSCode Extension not working for me

I cannot seem to make the VSCode Extension work for me.

Here’s my setup:

  • The extension is installed in VSCode
  • PSU is running in a Docker container on a Docker host (i.e. not localhost)

Now when I start the extension it insists my PSU is installed locally, it keeps starting a browser “http://localhost:5000” but this is wrong, it is “http://zbox:8082

So when I, for example, click on that link in “Login to PowerShell Universal” or the “Settings \ Configurations” link on the page (see screenshot) I always go to localhost.

So I manually type the correct URL and login. Then I select a Dashboard in PSU (the browser, not VSCode) and push the “Edit with VS Code” button, I get an error in VSCode

First, the popup shows the correct address so that hsould be OK I hope:

When I click the button “Open Visual Studio Code” I get:

Can someone make sense out of all this? I cannot see what I did wrong here. The only thing I can imagine is that the extension is not able to work with installs other then “localhost:5000” ?

Product: PowerShell Universal
Version: 3.9.2

Can you share what is currently in your settings.json file in relation to PSU? The URL\App token etc should only be coming from there.

What’s listed under Connections in the PSU activity pane?

Hi Adam,

tried to have a quick look, cannot find that file.
Can you tell me where that should be located?

If you press Ctrl+Shift+P and search for settings, you will find the option to open the JSON file.

image

1 Like

Had a thought, are you looking for that file from VSCode?

If so, here is the content:

{
     <cut settings not related to PSU and contains API keys and such>    
    "editor.wordWrap": "off",
    "diffEditor.wordWrap": "off",
    "editor.guides.indentation": false,
    "editor.guides.bracketPairs": false,
    "chatgpt.password": "xxxxx",
    "vs-chatgpt.apikey": "xxxx",
    "editor.fontSize": 14,
    "security.workspace.trust.untrustedFiles": "open",
    "window.commandCenter": true,
    "genieai.openai.organization": "xxxxx",
    "security.workspace.trust.enabled": false,
    "[powershell]": {
        "debug.saveBeforeStart": "nonUntitledEditorsInActiveGroup",
        "editor.semanticHighlighting.enabled": false,
        "editor.wordSeparators": "`~!@#$%^&*()=+[{]}\\|;:'\",.<>/?"
    },
    "terminal.integrated.defaultProfile.linux": "pwsh",
    "powerShellUniversal.samplesDirectory": "undefined",
    "powerShellUniversal.url": "http://zbox:8082",
    "powerShellUniversal.connections": [
    
        
    ],
    "powerShellUniversal.appToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiYWRtaW4iLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9oYXNoIjoiYzQ4MWUxYTItNjRhMC00NDFiLWFjOGQtODU1NGQ1MTg2MDA2Iiwic3ViIjoiUG93ZXJTaGVsbFVuaXZlcnNhbCIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6IkFkbWluaXN0cmF0b3IiLCJuYmYiOjE2ODIyNDI2NjQsImV4cCI6MTcxMzg2NTA2NCwiaXNzIjoiSXJvbm1hblNvZnR3YXJlIiwiYXVkIjoiUG93ZXJTaGVsbFVuaXZlcnNhbCJ9.s9LG-Ri4m5JnOC0FWwMaQfX31suIAJqODmtdkWqBto8",
    "window.zoomLevel": 1
}

Is this what you would be looking for?

It looks like it should be connecting to the proper URL based on the config you shared. In VS Code, can you let me know what the activity pane looks like? When it’s connected properly, you’ll be able to see things like scripts over there.

If you click the refresh button on the automation section, does it show a clearer error message? I’d also check in the extension host logs to see if there is more info in there.

Hi Adam,

Not sure what is going on but I just started VSCode and clicked the PSU icon in VSCode.
This is what I now see and it looks better then before I would think. Can you confirm this is what it should look like?

That appears to be working now. For example, you should be able to edit those endpoints you have defined under APIs on the left.

Yep, it seems to be working OK now