-
Notifications
You must be signed in to change notification settings - Fork 101
Add Reset-PSResourceRepository cmdlet to recover from corrupted repository store #1895
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
Add Reset-PSResourceRepository cmdlet to recover from corrupted repository store #1895
Conversation
…ettings Co-authored-by: alerickson <25858831+alerickson@users.noreply.github.com>
|
@copilot Add "'Reset-PSResourceRepository' in CmdletsToExport in Microsoft.PowerShell.PSResourceGet.psd1 |
Co-authored-by: alerickson <25858831+alerickson@users.noreply.github.com>
Added Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot in 'Reset(PSCmdlet cmdletPassedIn, out string errorMsg)', instead of copying files, just move them |
Co-authored-by: alerickson <25858831+alerickson@users.noreply.github.com>
Updated the Reset method to use Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…ions Co-authored-by: alerickson <25858831+alerickson@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: alerickson <25858831+alerickson@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@copilot pull in changes from master |
Merged master into the branch in commit fb8aef7. Successfully incorporated 17 commits from master with auto-merge of the module manifest. Build verified with no warnings or errors. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…into copilot/add-reset-functionality-to-repository-store
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
PR Summary
Implements a new
Reset-PSResourceRepositorycmdlet that allows users to reset the repository store (PSRepositories.xml) to its default state with only PSGallery registered. This addresses the issue where users have no way to recover when the repository store becomes corrupted.PR Context
When the PSResourceRepository.xml file becomes corrupted (e.g., through manual editing, file system errors, or incomplete writes), PSResourceGet cmdlets fail with XML parsing errors. Users were left with no built-in recovery mechanism and had to manually locate and delete the file, which is not user-friendly. This PR introduces a safe, built-in cmdlet to handle repository store reset with proper error handling and recovery mechanisms.
Key Features
-WhatIfand-ConfirmwithConfirmImpact=Highto ensure users understand the actionCheckRepositoryStore()to suggest usingReset-PSResourceRepositorywhen store is corruptedUtils.MoveFiles()for file operationsImplementation Details
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerOriginal prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.