#How can I have the VS Code PowerShell extension recognize a base class I defined in a .ps1 file?

4 messages · Page 1 of 1 (latest)

analog birch
#

I wrote two classes ("Base", "Derived"), each in a separate .ps1 file. The VS Code PowerShell extension reports an error ("Unable to find type [Base].") in the "Derived.ps1" file.

I already ran the "Base.ps1" in the PowerShell Extension terminal, but to no avail. The extension still doesn't recognize my base class when it parses the "Derived.ps1" file.

What can I do to have my base class be recognized during a programming session on the fly, without making any changes to my PowerShell profile or similar persistent configuration changes?

frosty leaf
#

Limitation of PS.

You can't. You'll have to either ignore the problem (then it's impact depends on use of the files) or put the classes in the same file.

analog birch
#

Ah, I see. Thanks a lot for enlightening me! 👍

frosty leaf
#

sucks I'm afraid, many of us want down that same "why can't I make this work" path