Powershell Find-Module Support ?
Hello, does the sleet endpoint work with Find-Module for powershell 6? I'm having trouble getting it to work, but not sure if it's even supported?
Thanks!
I'm not able to immediately find what version of NuGet is being used by powershell 6, but the original components used NuGet 2.x which does not support NuGet v3 feeds.
Sleet only supports v3 feeds. v2 feeds were based on OData and are difficult to make work with static files.
Hopefully PS updates to a newer version of NuGet.
Yeah I think that's right, I believe it's using v2 :( Thanks for the quick reply!
@emgarten - so I spoke too soon. Looks like the system default's were using NuGet v2 for package management. But the newer releases do support v3. You just have to update the "PowershellGet" module to latest (2.0.4) and the "PackageManagement" to latest (1.3.1).
Now I can find the modules on the sleet endpoint, and the data about the module is returned. However, when trying to install-module, I see an error like this:
WARNING: Could not get response from query '/virtualcatalog/data/72970b4e-d6b3-46da-8eaa-25edeeaa61c0.json'.
I see in the sleet bucket that there is no endpoint for virtualcatalog, so maybe something else is missing.
That seems odd. I know that NuGet client doesn't use the catalog, most feeds don't have one. I can't imagine PSGet would write their own implementation of the NuGet protocol.
Can you tell if PSGet is using NuGet.Protocol.dll?
You could try making a new feed with a real catalog by running init --with-catalog and then adding some packages. Then see if that feed works with PSGet.
virtualcatalog here isn't meant to be a real URL, it's just an IRI for json-ld which is RDF. The actual page is represented inline on the package details page.
If this can be improved on Sleet I'd like to fix it. I'm just not sure why this would happen using the NuGet.Protocol library.
I'm not sure, but I'm running with powershell 6 on mac and linux. I had to install dotnet core cli tools to use "publish-module" feature for nuget repos, so maybe it's using something from there. Here's the error I had earlier for that:
publish-module : For publish operations, dotnet command version '2.0.0' or newer is required to interact with the NuGet-based repositories. Please ensure that dotnet command version '2.0.0' or newer is installed and available under one of the paths specified in PATH environment variable value. You can also install the dotnet command by following the instructions specified at 'https://aka.ms/dotnet-install-script'.
dotnet/cli: https://github.com/dotnet/cli
FYI, PSGetV3 supports nuget v3 and should work with sleet. You can try it out: https://www.powershellgallery.com/packages/PowerShellGet/3.0.17-beta17
It does not use the catalog however
Using the released PSResourceGet module (which is the new version of PowerShellGet v3), I have been able to get a Sleet Azure Repository working with Find-PSResource without issue, after registering the Sleet Repository with Register-PSResourceRepository. However, I was unable to get Publish-PSResource to function, so my testing involved using sleet.exe to push existing modules already packaged by the old Publish-Module.
I'm unsure how to get Publish-PSResource to function against a Sleet Repository since Publish-PSResource expects credentials or an apikey. Would I be using the accesskey from the Blob Container? Or something else?
I'm unsure how to get
Publish-PSResourceto function against a Sleet Repository sincePublish-PSResourceexpects credentials or an apikey. Would I be using the accesskey from the Blob Container? Or something else?
It won't work that way, what you want to do is to use this syntax:
publish-psresource -verbose -debug -path /path/to/module.psd1 -DestinationPath /my/temp/path -erroraction silentlycontinue
to build the nuget package, and then use sleet.exe to upload it.