I have reasons for doing what I'm doing. As you might expect there are quite a bit of requirements, limitations and other considerations you don't know which makes this entire exercise look odd to you. I won't say the way I'm doing it is the best way. But I did find a solution for the problem I was trying to solve.Alexander Riedel wrote: ↑Tue Dec 14, 2021 10:36 am I am not sure why you do classes this way, that's for you to decide. But I do have to point out that the prescribed way to share code amongst otherwise unrelated items is to make them into a module.
Getting source code in Main
Forum rules
Do not post any licensing information in this forum.
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 any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Getting source code in Main
- Alexander Riedel
- Posts: 8478
- Last visit: Tue Mar 26, 2024 8:52 am
- Been upvoted: 37 times
Re: Getting source code in Main
I was not trying to imply you do anything wrong I just know folks are going to find this post down the road and wonder. So the module thing had to be said. That's all, no offense.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Getting source code in Main
No offense taken. It could be the case that one reason I'm trying to solve it this way is because I don't know everything there is to know about Powershell. But in case anyone is wondering why you'd do it this way my primary reasons are:Alexander Riedel wrote: ↑Tue Dec 14, 2021 10:47 am I was not trying to imply you do anything wrong I just know folks are going to find this post down the road and wonder. So the module thing had to be said. That's all, no offense.
1. Need everything self contained in the resulting executable from Powershell Studio (a Windows service)
2. Have object classes that I want to use in Main and child processes/jobs
If using modules can satisfy both of these points then I'll look at them if there's a good link handy to do some reading.