PSD1 Manifest file fails to load first

Hello All

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 ?


What happens if you run Test-ModuleManifest on the network path psd1 file?

I get the correct output, Odd indeed!

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.

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?

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.