-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't accept -Version
if string array was supplied to -Name
in Install-PSResource
and Save-PSResource
#1751
Comments
We are wondering about a use case where you want multiple packages of the same version (like multiple Az packages) |
This behavior is useful for a collection of modules that all share the same release version. Like the Az module mentioned above or when PSRG supports NuGet that would be a common use case. |
I obviously don't agree this is a nice feature since I created this issue. I believe this functionality can cause more confusion than being helpful. Az modules often don't have the same version. Here are the latest version of Az.* modules, filtering away anything older than published the last 180 days. Find-PSResource -Repository 'PSGallery' -Name 'Az', 'Az.*' |
Where-Object -FilterScript {
$_.'Author' -eq 'Microsoft Corporation' -and
$_.'PublishedDate' -gt [datetime]::Now.AddDays(-180)
} |
Sort-Object -Property 'Name' |
Select-Object -Property 'Name', 'Version', 'PublishedDate' |
New-MDTable |
Set-Clipboard
|
Prerequisites
Steps to reproduce
With Microsoft.PowerShell.PSResourceGet v1.0.6 you can supply
-Version
when supplying multiple resources with-Name
.That does not make much sense and should error instead of event trying, in my opinion.
Example command:
Expected behavior
ERROR: -Version can only be supplied if -Name is a single value.
Actual behavior
Error details
No response
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: