microsoft / vscode-azureAutomation

MIT License
17 stars 4 forks source link

Cannot open Automation Scripts in VSCode #15

Closed cshawbcn closed 1 year ago

cshawbcn commented 1 year ago

Does this occur consistently? Yes Repro steps: <>

  1. Find automation account
  2. Try to open script

Action: automation.openLocal Error type: ENOENT Error Message: ENOENT: no such file or directory, open 'c:\Program Files\Microsoft VS Code//vscodeAutomation//redacted:id//scriptname.ps1'

Version: 1.0.7 OS: win32 OS Release: 10.0.19044 Product: Visual Studio Code Product Version: 1.73.1 Language: en

Call Stack ``` extension.js:2:1646595extension.js:2:1646595 n extension.js:2:1640523 ```

Works by running VSCode as admin. Permission issue as trying to write into 'C:\Program Files\Microsoft VS Code' folder

kapil-azure-automation commented 1 year ago

Hi @cshawbcn, Thanks for bringing this up. To change default directory using cmd "change directory" from command palette (ctrl+Shift+P). For example: changing directory to "C:\abc" would use runbooks in "C:\abc\vscodeAutomation.."

This should help by changing directory to a path where current user has permissions. Will look into how we can make this more meaningful and clear error message.

kapil-azure-automation commented 1 year ago

Please reopen if issue persists.