Skip to content
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

Use RequiredVersion 1.9.2 but download dependencies with v2.1.0 #2164

Closed
yuanweilei opened this issue Jul 15, 2023 · 5 comments
Closed

Use RequiredVersion 1.9.2 but download dependencies with v2.1.0 #2164

yuanweilei opened this issue Jul 15, 2023 · 5 comments

Comments

@yuanweilei
Copy link

yuanweilei commented Jul 15, 2023

I run this command on my local PowerShell to save v1.9.2, but some dependencies with v2.1.0 is downloaded. Could you please tell me why?
Save-Module -Name Microsoft.Graph -RequiredVersion 1.9.2 -Path .\modules

For example, Microsoft.Graph.Applications.
image

@ghost ghost added the ToTriage label Jul 15, 2023
@yuanweilei yuanweilei changed the title Use RequiredVersion 1.9.2 but download dependencies with v2.0.0 Use RequiredVersion 1.9.2 but download dependencies with v2.1.0 Jul 15, 2023
@peombwa
Copy link
Member

peombwa commented Jul 17, 2023

The ability to install older versions of the SDK was added in v1.12.2. All versions prior to v1.12.2 didn't support an exact version match for their dependencies. See v1.12.2 release notes for more details - https://github.com/microsoftgraph/msgraph-sdk-powershell/releases/1.12.2.

Please use the latest version of v1.x (v1.28.0) if your goal is to use v1.x - Install-Module -Name Microsoft.Graph -RequiredVersion 1.28.0.

@yuanweilei
Copy link
Author

yuanweilei commented Jul 17, 2023

@peombwa
Thank you very much! I will try to use 1.12.2.

Could I ask you another question? I asked this question here
About 10 days ago (before v2.0.0 release), I used the same command but Microsoft.Graph.Applications v1.9.6 was downloaded. You told me that v1.28.0 is the latest version of v1.x, but why v1.9.6 was downloaded?

Save-Module -Name Microsoft.Graph -RequiredVersion 1.9.2 -Path .\modules

@peombwa
Copy link
Member

peombwa commented Jul 17, 2023

I'd recommend you use v1.28.0 as it is the latest stable release of the v1.x SDK.

As for:

About 10 days ago (before v2.0.0 release), I used the same command but Microsoft.Graph.Applications v1.9.6 was downloaded. You told me that v1.28.0 is the latest version of v1.x, but why v1.9.6 was downloaded?

Save-Module -Name Microsoft.Graph -RequiredVersion 1.9.2 -Path .\modules

This is more of a question for the author of the Save-Module command. My theory is:
Save-Module installs any version of Microsoft.Graph.Authentication greater than or equal to 1.9.2 since 1.9.2 is specified as the minimum version. This is because in all versions prior to v1.12.2, the dependency version of Microsoft.Graph.Authentication was specified under ModuleVersion (>=). This was later changed to RequiredVersion (=) in v1.12.2+ to support installation of older versions. See https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_module_manifests?view=powershell-7.3#requiredmodules for more details:

ModuleVersion - Specifies a minimum acceptable version of the module.
RequiredVersion - Specifies an exact, required version of the module.

@yuanweilei
Copy link
Author

@peombwa
Thank you again. Understood the question above is regarding Save-Module.

I am still confused why Microsoft.Graph -RequiredVersion 1.9.2 got v1.9.6 not the latest v1.28.0, but maybe I should ask this question on PowerShell side.

I just guess, maybe v1.9.6 is the last version of v1.9.z, so it is download. (There are versions of v1.10.0, 1.11.0, ..., v1.28.0 >= v1.9.2)

@peombwa
Copy link
Member

peombwa commented Jul 18, 2023

Awesome! The author of Save-Module is the right contact point for the question.

I'll close the issue since the original question has been answered by #2164 (comment). Feel free to open a new issue if the problem persists.

@peombwa peombwa closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants