question

DavidZemdegs avatar image
0 Votes"
DavidZemdegs asked DavidZemdegs answered

Powershell V7 and modules and language mode

Hi,
I have finally decided to default to PS V7 instead of 5.1.
I have a module installed that I have been using in the old v1.0\modules.
I have installed the latest version of VS code and the powershell extension and edited the json file in VS Code to default to PS V7.
When I run get-module -listavailable it shows my module.
However when I run some code calling functions in that module it says my functions are not recognised.
I can run import-module xxxx fine. Even after importing the module it cannot find my functions.

On other thing - it doesnt like my [pscustomobject] accelerator - something about only core types are supported in this language mode.
Thanks
David Z

windows-server-powershell
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

What does "Get-Command -Name xxxx" return?

0 Votes 0 ·

It says XXXX is not recognised as the name of a cmdlet etc...

0 Votes 0 ·

1 Answer

DavidZemdegs avatar image
0 Votes"
DavidZemdegs answered

Found it. When I start VS Code I have to right click and 'Run as Administrator' even though I am logged on as an administrator.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.