Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.158
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.16299.0
I'm attempting to make a powershell project with multiple classes, and I'd like to keep each class in its own separate folder. However as these classes need to reference each other I'm having trouble as the classes don't seem to know about each other.
Startup.pss is able to get type information and auto complete for classes in other files, but none of the class files themselves auto complete for other classes and Powershell Studio reports unknown types. Building the project works fine and inserting 'using module .\class.ps1' sometimes fixes the issue but it seems buggy.
To recreate, create a project add two separate class files, and add one as a member of the other.
Classes in multiple files
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Classes in multiple files
When PowerShell Studio runs a syntax check, it only does it for the open file. That is why PowerShell reports that it can't resolve the type.
Maybe we could filter out these false errors in a future build.
Maybe we could filter out these false errors in a future build.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Classes in multiple files
That would be greatly appreciated. startup.pss manages to get class info from the other files fine.
In the meantime I guess I'll just have to cram all my classes into one file.
In the meantime I guess I'll just have to cram all my classes into one file.