I can’t connect VSCode to Powershell Universal. When I go to the Pwershell Universal admin console, I should find a “configure” option under “settings” and then I should be able to click on “edit with VSCode”, but “configure” is not there.
Product: PowerShell Universal
Version: 1.4.6
You don’t do anything in PSU itself other than generate an app token for the identity you want to link to VS Code.
In VS Code, if you open the settings, you can filter by @ext:ironmansoftware.powershell-universal to enter your PSU identity app token and the FQDN to PSU.
I’m stuck in the same spot. All the VS Code Extension articles and videos tell you to go to Configuration under settings, but that doesn’t exist for me.
I tried manually creating an app token and pasting it into settings in vs code (searched for @ext:ironmansoftware.powershell-universal) and I updated the power shell universal to my port since I use 5001 not 5000. But that doesn’t seem to work.
Edit: I figured it out (sorta).
I’m not sure what issue(s) you all seem to have but, as I stated already in the comments abovve, you don’t do anything in PSU itself aside from generating the App Token to use with the VS Code extension to give it access to the PSU server. The article you seem to be referencing (https://docs.powershelluniversal.com/development/visual-studio-code-extension) is either wrong or maybe outdated, but there is no Configuration section under the Settings area in the admin UI as of 5.5.4, so you can go to Security->Tokens->Create Application Token to generate a token to enter into the VS Code extension.
The rest of the setup is done in the extension, and you either define the PSU URL (the FQDN) via powerShellUniversa.url if you only have a single PSU instance to connect to, or define an array via powerShellUniversal.connections to connect to multiple PSU servers by editing the settings.json file directly.
I haven’t seen any articles about how to configure the extension (because it’s literally just a token and an FQDN, and you’re done).
All you really need are the following lines:
Single instance:
"powerShellUniversal.appToken": "<APP TOKEN>",
"powerShellUniversal.url": "https://<PSU FQDN>",
"powerShellUniversal.samplesDirectory": "<PATH>",
Multiple instances:
"powerShellUniversal.appToken": "<APP TOKEN>",
"powerShellUniversal.samplesDirectory": "<PATH>",
"powerShellUniversal.connections": [
{
"name": "<PSU 1 Friendly Name",
"url": "http://<PSU 1 FQDN>",
"appToken": "<APP TOKEN>"
},
{
"name": "<PSU 2 Friendly Name",
"url": "http://<PSU 2 FQDN>",
"appToken": "<APP TOKEN>"
}
]
Here is some additional info that might help
So before you jump into VScode, you need to generate an App token in Powershell Universal. @Jesse.Peden explains where you can do that.
Here is how you can use the token in VSCode:
- Install extension
- Powershell Universal (Ironman Software)
- Powershell (Microsoft) (Not sure if this one is necessary, but might as well)
- Click on the new Icon (Powershell Universal)
- Hover over Connections and a + sign will appear. Click on the + sign and a settings page will open.
- Add token that you generated from Powershell Universal
- Change the URL to reflect your environment
- Save settings page and close VScode.
Now, when you start VScode next time and click on the Powershell Universal icon (step 2), it will automatically log you Powershell universal environment and load your modules.