This topic contains 5 replies, has 2 voices, and was last updated by
March 21, 2015 at 6:12 am #23549
I've created a new module and manifest powershell v4
I understand how to put these together with the directoryName and psm1 & psd1 being all the same name, the module path being in the PSModulePath
I also understand the load order of these (psd1 then psm1)
The weird behavior I'm encountering is this:
When I have the module in my local module path (in my MyDocuments\WindowsPowerShell\Modules\MyModule)
I use import-module MyModule -verbose
I see that the manifest is read first (psd1) then the module file (psm1), and things work as expected.
Because some others will use this module I setup a network location (e.g. \\SERVER\Scripts\Modules\MyModule) place the files there
and move the module directory to that folder, add the path to the PSModulePath.
When I run 'import-module MyModule -verbose the psm1 file loads but not the psd1. Moving it back to my local directory and trying again, works as expected.
Am I missing something ?
March 21, 2015 at 7:51 am #23550
What happens if you run Test-ModuleManifest on the network path psd1 file?
March 21, 2015 at 9:20 am #23551
I get the correct output, Odd indeed!
March 21, 2015 at 9:52 am #23552
Weird. I suppose you could try renaming the PSM1 file, so the only file which has a name matching the module directory is the manifest. Even if it doesn't work, it might shed some more light on what's going on.
March 21, 2015 at 1:15 pm #23553
Strangely it seems if the psd1 is on a dfs UNC path the manifest will not load?
When I use the normal path it works ok, have you heard of this before?
March 21, 2015 at 1:23 pm #23554
Well, I've heard of people having trouble with their execution policy (RemoteSigned) in conjunction with DFS paths. If you add the DNS name of the DFS path to the Local Intranet zone in IE, that generally clears it up.
I haven't heard of module manifests failing to load under those circumstances, but it's still worth a try.
The topic ‘PSD1 Manifest file fails to load first’ is closed to new replies.