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
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?
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.