Skip to content

Add verbose logging to Invoke-HttpRequestWithRetry#530

Merged
jaredfholgate merged 4 commits intomainfrom
feature/verbose-logging-http-requests
Mar 26, 2026
Merged

Add verbose logging to Invoke-HttpRequestWithRetry#530
jaredfholgate merged 4 commits intomainfrom
feature/verbose-logging-http-requests

Conversation

@jaredfholgate
Copy link
Copy Markdown
Member

Adds Write-Verbose logging to Invoke-HttpRequestWithRetry so HTTP request details and errors are visible when running with -Verbose.

Changes

  • Log request method, URI, retry config, timeout, and download path on entry
  • Log each attempt number
  • Log transient status codes before retrying
  • Log final status code on success with SkipHttpErrorCheck
  • Log download completion with file path
  • Log status code and exception message on errors

- Log request method, URI, retry config, timeout, and download path on entry
- Log each attempt number
- Log transient status codes before retrying
- Log final status code on success with SkipHttpErrorCheck
- Log download completion with file path
- Log status code and exception message on errors
…ithRetry

- Replace Write-Warning with Write-ToConsoleLog -IsWarning for retry messages
- Add Write-ToConsoleLog -IsError with detailed error info before throwing
- Include status code, exception message, and response body in error output
- Delimit variable name with braces (\:) to prevent PowerShell
  parsing it as a drive-qualified variable reference
- Replace empty catch block with Write-Verbose to satisfy PSScriptAnalyzer
@jaredfholgate jaredfholgate self-assigned this Mar 26, 2026
@jaredfholgate jaredfholgate merged commit a7b0b3c into main Mar 26, 2026
6 of 7 checks passed
@jaredfholgate jaredfholgate deleted the feature/verbose-logging-http-requests branch March 26, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Triage 🔍 Needs triaging by the team

Projects

Development

Successfully merging this pull request may close these issues.

2 participants