Skip to content

Cmdlet status - #2082

Open
alerickson wants to merge 4 commits into
PowerShell:masterfrom
alerickson:cmdletStatus
Open

alerickson wants to merge 4 commits into
PowerShell:masterfrom
alerickson:cmdletStatus

Conversation

@alerickson

Copy link
Copy Markdown
Member

PR Summary

PR Context

PR Checklist

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 thread src/code/Utils.cs
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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants