Author Posts

October 28, 2017 at 12:19 pm

Hi,
how do I publish dsc resources to local psgallery so I can find them with find-dscresource?
I was not able to do that with publish-module, must be missing something:

1. I've created class based dsc resource as described here: https://docs.microsoft.com/en-us/powershell/dsc/authoringresourceclass (basically copy pasted the resource for testing)
2. Verified locally that the dsc resource is available via

Get-DscResource

3. Published it to local PS repository

Publish-Module -Name FileResource -Repository 'localpsrepo' -NuGetApiKey mykey

Find-Module -Repository 'localpsrepo' lists FileResource module
Find-DSCResource -Repository 'localpsrepo' lists no results

October 30, 2017 at 12:22 pm

Maybe something in your manifest metadata that it doesn't like? Try publishing one of the "official" dsc resource modules to your repository, like xPSDesiredStateConfiguration, see if you can find that once it's published.

October 30, 2017 at 1:40 pm

I have already tried few modules I've saved from PSGallery, the result is the same, module is listed, but not the dsc resources.

October 30, 2017 at 5:08 pm

Just tried it with MyGet.org, same result, either I'm repeating same mistake, or this is just not working with private/internal nuget repositories?

October 30, 2017 at 7:52 pm

In the PS Gallery this works based on either the tag: DSCResource or DSC.
Please check to see if you have the latest version of PowerShellGet from the PowerShell Gallery, as we made changes a while ago to make this work seamlessly. The current version will extract those tags from PrivateData\PsData section of the module manifest, and feed it to the NuGet client automatically.
You can try specifying these tags using Publish-Module ... -Tags DSCResource,DSC
If that doesn't work, please report this as an issue in github.com/powershell/powershellget. We'll need the following info:
$psversiontable;
get-module powershellget -li

October 31, 2017 at 11:03 am

I have updated powershellget to 1.5.0.0, tried to publish-module with -tags DSC,DSCResource the result was the same.
On another note, Find-DSCResource lists dsc resources if I specify the -modulename parameter.

October 31, 2017 at 12:11 pm

So for reference I use an internal repository server I created using the nuget dsc module. Very barebones but I'm able to publish and find dsc resources on that server with no issue. Maybe give that one a try and see if you have the same issue?

November 2, 2017 at 12:36 pm

Got an answer on github that myget does not tag based searches, I guess same goes for artifactory.
https://github.com/PowerShell/PowerShellGet/issues/184