- This topic has 3 replies, 2 voices, and was last updated 2 months, 3 weeks ago by
March 6, 2020 at 5:52 pm #208899ParticipantTopics: 17Replies: 24Points: 80Rank: Member
Recently i created a module, added it to azure devops.
Everything works great, I subscribe to the feed, added it as a repository (after additional problems required installing
I was able to get the module pulled down local and autoload great in v5.
However in v4 i wasnt seeing the module.
The directory was
I tried alot of things and finally thought what if i move it to
I did this and life was happy, however i would like thoughts on best way to do this for all powershell versions and if possible without having to give up module version folder name.
- This topic was modified 2 months, 3 weeks ago by Jason McMahan.
March 6, 2020 at 8:21 pm #208929ParticipantTopics: 12Replies: 1622Points: 2,560Rank: Community Hero
With a directory path ModuleTest\0.1.1.0\moduletest.psm1, the goal would be to have multiple versions under the same module? Typically, the PSM1 and PSD1 are in the root of the module directory. The module version is identified in the PSD1, not traditionally in the folder structure that is client-side. In the repo, there may be a version structure like 0.1.1.0\ModuleTest\moduletest.psm1, but the repository would just use that as the latest version.
March 8, 2020 at 6:11 pm #209136ParticipantTopics: 17Replies: 24Points: 80Rank: Member
Thank you for the reply Rob,
I was thinking that as well but following this article unless i misunderstood it it will work on v5 but the problem is prior it will not work.
So its like ok then how to separate v5 from prior version and do something at download so prior versions can see the modules.
March 9, 2020 at 1:54 pm #209232ParticipantTopics: 12Replies: 1622Points: 2,560Rank: Community Hero
Personally not had multiple versions under a single module, but I think the key is that you have to add references to the individual modules.
$p = [Environment]::GetEnvironmentVariable("PSModulePath") $p += ";C:\Program Files\Fabrikam\Fabrikam8;C:\Program Files\Fabrikam\Fabrikam9" [Environment]::SetEnvironmentVariable("PSModulePath",$p)
Powershell 5 module search may parse this structure without adding the entries above, but Powershell 4 or lower need specific references for additional roots to search. My guess is the logic is Powershell is doing a Get-ChildItem search in Powershell 4 and Powershell 5 is doing a -Recursive search for modules.
- You must be logged in to reply to this topic.