VS Code Extension - Failed to query configurations

Having an issue with the PowerShell Universal VS Code extension connecting to a remote PowerShell Universal instance. The extension half works. Currently I am able to access any .PS1 files that are in the \PowershellUniversal\Repository folder. However, any scripts that are in any subfolders,

example: \PowershellUniversal\Repository\Test

the VS Code extension cannot open them. The extension gives the following error message: Error running command powershell-universal.editScript: Running the contributed command: ‘powershell-universal.editScript’ failed… This is likely caused by the extension that contributes powershell-universal.editScript.

Also related, when the VS Code extension is first clicked on upon launching VS Code, it gives the error: Failed to query configurations. This is also related to the subfolder issue because the “.universal” folder is a subfolder under \PowershellUniversal\Repository\

We have combed through the permissions for Repository folder and it’s subfolders, and have not found any issues. Upon moving a .PS1 file from one of the subfolders directly to the “Repository” folder, it is able to be opened in VS Code.

Any help would be greatly appreciated.

Product: PowerShell Universal
Version: 1.4.6

VS Code Extension version: 1.8.1

We currently do not support files in subdirectories. We’ll need to implement some changes to the Universal server to make this work.

Hey Adam, thank you for the quick response. Does that still apply to the “.universal” folder that contains all the configuration files? I thought that the VS Code extension was supposed to be able to remotely edit those files, under the ‘Configuration’ section of the extension.

Also, the scripts that are in the subfolders are able to be edited in the web interface and also able to run them in Automation. So are the subfolders just not supported in the VS Code extension?

Thanks again for the help.

This shouldn’t apply to the .universal folder since we reference those files directly and not via the same method as the dashboard and script files.

It is a good point that you can edit these in the UI so it has me thinking that the web server is actually setup correctly to deal with paths and we just need to update the VS Code extension to support this.

Thanks Adam, we figured out the .universal folder issue. Used the administrator app token and that fixed that issue.

We found that if you manually create the same subfolder structure that is setup on the Universal Server at C:\Users\User\AppData\Local\Temp.universal.code.script on the client where VS Code is, it actually lets you open those subfolder scripts now. Just doesn’t let you save them back to the server if edited.

1 Like

I have submitted a PR to fix this: Update scripts.ts by icanhazpython ¡ Pull Request #26 ¡ ironmansoftware/universal-code ¡ GitHub

1 Like