Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
PowerShell seperate Module/Script feeds with dependancies.
-
I recently setup ProGet with two PowerShell (nuget) feeds, one for scripts and one for modules. then registered it as a PSRepository:
Register-PSRepository -Name MyGallery -InstallationPolicy Trusted -PackageManagementProvider NuGet -SourceLocation https://proget/nuget/psmodules -PublishLocation https://proget/nuget/psmodules -ScriptSourceLocation https://proget/nuget/psscripts -ScriptPublishLocation https://proget/nuget/psscripts
I am able to publish to both feeds no problem. I then created a script, with a #Requires statement that says it requires one of the modules I have published in the psmodules feed, here's where I run into problems.
When I use Install-Script, it fails because it cannot find the required module. this happens whether I have the module installed on my box or not. if you go to the web page for the script, you can see the dependency, but if you hover over the link, it wants to look in the psscripts feed, which is obviously not where it resides.
if I try to merge into one feed, I get an error on the powershell side when trying to register a PSRepository with the same URI for SourceLocation and ScriptSourceLocation:
PackageManagement\Set-PackageSource : SourceLocation 'https://proget/nuget/powershell' and ScriptSourceLocation 'https://proget/nuget/powershell' should not be same for URI based repositories.
I'm not sure what to do here, if you do Get-PSRepository -name PSGallery | Select * here is the output:
Name : PSGallery
SourceLocation : https://www.powershellgallery.com/api/v2/
Trusted : True
Registered : True
InstallationPolicy : Trusted
PackageManagementProvider : NuGet
PublishLocation : https://www.powershellgallery.com/api/v2/package/
ScriptSourceLocation : https://www.powershellgallery.com/api/v2/items/psscript/
ScriptPublishLocation : https://www.powershellgallery.com/api/v2/package/
ProviderOptions : {}
But I'm not sure how to replicate this kind of structure in ProGet, it doesn't seem like the URL of feeds can be messed with.
Thanks for any help.
Product: ProGet
Version: 4.6.0
-
Hi Thomas,
This is something you'll want to bring up with the PowerShellGallery team; we do not maintain the client, and are not familiar with this particular message/error.
It's very possible that the particular command you're trying will only ever work with powershellgallery.com, which is not the PSG team's design intent... but sometimes happens. They generally are able to address issues like this in the client fairly quickly.
If you hear a resolution, please share it here so anyone else searching for the problem can find it.
-