Repository navigation
Cmdlet status - #2082
Open
alerickson wants to merge 4 commits into
Open
Cmdlet status#2082alerickson wants to merge 4 commits into
alerickson wants to merge 4 commits into
Conversation
…uest fails with a 404 or 5xx, add a manual Test-PSGalleryOutage.ps1 script to simulate gallery outages
alerickson
requested review from
Sydney Smith (SydneyhSmith),
Aditya Patwardhan (adityapatwardhan),
Anam Navied (anamnavi) and
shammu1
as code owners
November 5, 2026 19:32
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
The outage handling lacks automated regression coverage, and the test script can append its hosts mapping onto an existing line, causing DNS failures and incomplete cleanup.
2 open issues
What changed in this PR
This PR improves PSResourceGet error reporting by directing users to the PowerShell Gallery status page for Gallery 404 and server-error responses.
Changes:
- Adds Gallery-specific status hints to V2 request and publish errors.
- Suppresses secondary parse and not-found errors after failed requests.
- Adds a manual outage simulator for Find, Install, Save, Update, and Publish.
| File | Description |
|---|---|
test/Test-PSGalleryOutage.ps1 |
Adds a local outage simulator and cleanup logic. |
src/code/V2ServerAPICalls.cs |
Preserves request errors and suppresses redundant follow-up errors. |
src/code/Utils.cs |
Adds Gallery host/status checks and status-hint formatting. |
src/code/PublishHelper.cs |
Appends Gallery status hints to publish failures. |
src/code/FindHelper.cs |
Skips further response handling after reported request errors. |
Review effort: Balanced
Comment on lines
+232
to
+234
| public static string FormatRequestsExceptions(Exception exception, HttpRequestMessage request, HttpStatusCode statusCode) | ||
| { | ||
| return FormatRequestsExceptions(exception, request) + GetPSGalleryStatusMessage(request?.RequestUri, statusCode); |
|
|
||
| try { | ||
| if (-not $SkipHostsFile) { | ||
| Add-Content -Path $hostsFile -Value $hostsLine |
This branch has not been deployed
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.

PR Summary
PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.