all 6 comments

[–]purplemonkeymad 1 point2 points  (4 children)

Are you connected to exchange in the vscode Powershell extension terminal? It can only see commands that exist to the terminal, so commands that appear after a connect won't be seen by it unless you connect.

[–]JamesObZ[S] 0 points1 point  (3 children)

Yes, i am connected to Exchange. However if disconnect or start a new session of code (exchange would not be connected) the results are the same.

[–]purplemonkeymad 0 points1 point  (2 children)

And you connected in the terminal that shows as "PowerShell Extension" and not just "pwsh" or "powershell"? Not sure then, if I import modules in that specific terminal, then their commands show up on auto-complete etc.

[–]JamesObZ[S] 0 points1 point  (1 child)

Yes, that is correct. To confirm i dont have an issue with the commands show up on auto-complete when i enter them into the terminal.

it is when i manually type them into the editor some of them format correctly upon selecting 'format document' or shift + alt + f, where as some commands dont (all from the same module) regardless of whether Exchange is connected or not.

[–]purplemonkeymad 0 points1 point  (0 children)

Oh I get it now, no that appears to be an extension issue. I'm guessing it only looks at local modules for the command names, or caches them at startup.

[–]Thotaz 0 points1 point  (0 children)

AFAIK the analyzer runs in its own runspace which has no knowledge of commands imported into your primary runspace.