Author Posts

July 19, 2018 at 6:19 am

Hi!

I have a real strange 'Problem' with an internal PSRepository and one module that I am publishing.

The Repository is a fileshare on our 2016 Windows Server FileServer.

I publish the module with the parameter (I will remove the companyName from the values and replace it with 'Module')

Publish-Module -Name Module.SCCM -Repository "ModulePSRepository"

It gets published and everything is fine. I can find the module again and install it with "Find-Module" and "Install-Module". It works from all the servers that need to install it.

The strange thing that I experience however is when I browse to the fileshare I cannot find the actual module files. It's empty. All that I can find is the .nupkg file (Module.SCCM.0.0.2.nupkg), but the actual module folder does not exist at all.
If I try to publish it again I obviously get an error message saying module already exists. If I delete the .nupkg file I can upload it again, but I get the same result.

I've uploaded 4 other modules and I can see them together with their .nupkg files.

This is the VERBOSE output of the publish that I am doing. (I have replaced the actual servername)

VERBOSE: Repository details, Name = 'ModulePSRepository', Location = '\\servername\ModulePSRepository$';
IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Repository details, Name = 'ModulePSRepository', Location = '\\servername\ModulePSRepository$';
IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Publish Location:'\\servername\ModulePSRepository$'.
VERBOSE: Module 'Module.SCCM' was found in 'C:\Program Files\WindowsPowerShell\Modules\Module.SCCM\0.0.2'.
VERBOSE: Populating RepositorySourceLocation property for module Module.SCCM.
VERBOSE: Loading module from path 'C:\Users\cadminthn\AppData\Local\Temp\1049968130\Module.SCCM\Module.SCCM.psm1'.
VERBOSE: Repository details, Name = 'ModulePSRepository', Location = '\\servername\ModulePSRepository$';
IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'ModulePSRepository'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is '\\servername\ModulePSRepository$' and PackageManagementProvider is 'NuGet'.
VERBOSE: Total package yield:'0' for the specified package 'Module.SCCM'.
VERBOSE: Repository details, Name = 'ModulePSRepository', Location = '\\servername\ModulePSRepository$';
IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'ModulePSRepository'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is '\\servername\ModulePSRepository$' and PackageManagementProvider is 'NuGet'.
VERBOSE: Total package yield:'0' for the specified package 'Module.SCCM'.
VERBOSE: Performing the operation "Publish-Module" on target "Version '0.0.2' of module 'Module.SCCM'".
VERBOSE: Successfully published module 'Module.SCCM' to the module publish location
'\\servername\ModulePSRepository$'. Please allow few minutes for 'Module.SCCM' to show up in the search results.

What am I missing?

July 19, 2018 at 7:15 pm

So... just so I understand what you're asking. The repository normally wouldn't contain anything but the package file... are you expecting both the package and the module source?

Keep in mind that Nuget is also designed (well, was FIRST designed) for binary packages. Meaning, you'd never expect the source code to be in the repo, you'd only expect the distribution package. Kinda the same thing here...?

July 20, 2018 at 6:47 am

Hi Don!

Exactly, I expected both the package and the module source to be there. Mostly because I wanted everyone else to be able to read the source code.
To be honest I didn't exactly understand how it worked and I just assumed that both would be there, as 4 other modules had both the nuget package and the source files in the repository. I realize now that I probably had manually put them there.

I just got stuck on that and then stubbornly wanted my other module to behave the same (without realizing it was behaving the same all this time).

Now that you directed me in the right way, I actually opened the documentation which I should've done in the first place and now I understand it clearly. You learn everyday 🙂

I will just have to find another place where they can read and contribute to the code (Some Git/SVN repository most likely) and then distribute new versions from there to the repository.

Thanks for your insight Don!