Set-ToolsRepo: Allow older VM Tools uploads without modifying metadata.json#385
Merged
Kavyareddyguntaka11 merged 8 commits intomainfrom Apr 3, 2026
Merged
Set-ToolsRepo: Allow older VM Tools uploads without modifying metadata.json#385Kavyareddyguntaka11 merged 8 commits intomainfrom
Kavyareddyguntaka11 merged 8 commits intomainfrom
Conversation
…tadata only when the latest version is uploaded
1: Removed forced PowerShell progress setting. 2: Removed temp directory cleanup logic. 3: Fixed rooted archive path issue when discovering vmtools folder. 4: Normalized archive path and unified datastore destination path building. 5: Ensured top-level GuestStore artifacts are copied (metadata.json update rules unchanged).
Closed
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Set-ToolsRepo (Microsoft.AVS.Management run command) to allow uploading older VMware Tools versions without overwriting the top-level metadata.json, while keeping the “latest version” metadata behavior intact. Adds/updates Pester coverage to validate the new metadata decision logic.
Changes:
- Adjusts
Set-ToolsRepocopy/metadata logic to only overwrite top-levelmetadata.jsonwhen the incoming version is greater than the existing highest version. - Improves path handling for extracted archive paths and datastore browsing.
- Adds mock-only Pester tests to validate “older vs newer vs existing version” behaviors.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
Microsoft.AVS.Management/Microsoft.AVS.Management.psm1 |
Updates Set-ToolsRepo logic for version comparison, selective metadata overwrite, datastore browse path usage, and refactors copy flow. |
tests/Microsoft.AVS.Management.Tests.ps1 |
Adds mocks/types needed for module import and introduces InModuleScope mock-only tests around version/metadata decision logic. |
Contributor
Author
|
@microsoft-github-policy-service agree |
et1975
reviewed
Apr 2, 2026
et1975
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR re-creates the previously approved changes from #375 using a personal branch in the Azure repository, as fork-based PRs do not run CI.
Summary
This change updates the
Set-ToolsReporun command behavior to allow uploading older VM Tools versions without modifyingmetadata.json, while still preserving the latest version metadata.Changes
metadata.jsonValidation
Additional Changes
This PR replaces the earlier fork-based PR (#375) with the same functionality, following the recommended Azure repo workflow.