Background:
From my project, I have created a few PowerShell classes currently contained by a single file.
As the project is growing (the number and size of the classes), I would like to separate my classes over multiple files.
The problem with doing so is that the classes are interdependent.
see: Is it possible to declare two interdependent classes each in a separate file?
mcve setup:
- Create two PowerShell files as shown in the StackOverflow question:
.\Source\Classes\a.ps1
.\Source\Classes\b.ps1
- and a single
module.psm1 file in the root containing:
. $PSScriptRoot\Source\Classes\a.ps1
. $PSScriptRoot\Source\Classes\b.ps1
Export-ModuleMember -Function a, b
The issue(s) with this are in fact shown by VSCode (the PSScriptAnalyzer)
In the comment of the related StackOverflow question @TheMadTechnician, suggests that maybe this is something PSDepend could help.
If that is correct, can you show (or refer to) an example based on this mcve?
Background:
From my project, I have created a few PowerShell classes currently contained by a single file.
As the project is growing (the number and size of the classes), I would like to separate my classes over multiple files.
The problem with doing so is that the classes are interdependent.
see: Is it possible to declare two interdependent classes each in a separate file?
mcve setup:
.\Source\Classes\a.ps1.\Source\Classes\b.ps1module.psm1file in the root containing:The issue(s) with this are in fact shown by VSCode (the PSScriptAnalyzer)
In the comment of the related StackOverflow question @TheMadTechnician, suggests that maybe this is something PSDepend could help.
If that is correct, can you show (or refer to) an example based on this mcve?