Fetch HTTP response metadata in PowerShell
Build a paste-ready command, then review its compatibility and effects before running it.
Invoke-WebRequest -Uri <url> -Method HeadComplete required fields to copy the generated command.
Compatibility
WindowsVerified for Windows using powershell syntax.
Operational knowledgereview due 2027-01-19
RequirementsInvoke-WebRequestInvoke-WebRequest must be installed and available on PATH.Network accessThe target must be reachable from the current environment.
Version supportInvoke-WebRequest Current supported releasesVerified for windows using powershell syntax; consult compatibility notes for platform-specific differences.
Expected signalsStatusCode : 200Representative successful output; values vary with the selected target and system state.
Known errorsInvoke-WebRequest: command not foundInvoke-WebRequest is missing or is not available on PATH.
VerifyInvoke-WebRequest -Uri {{url}} -Method HeadThe output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01Invoke-WebRequestCommandRuns the Invoke-WebRequest stage of this one-liner.
02-UriOptionConfigures Invoke-WebRequest with the -Uri option.
03<url>ParameterA value supplied in the Fill parameters section.
04-MethodOptionConfigures Invoke-WebRequest with the -Method option.
05HeadArgumentPasses Head to Invoke-WebRequest.
Example input
Invoke-WebRequest -Uri https://example.com -Method Head
Example output
StatusCode : 200
StatusDescription : OK
Content :
RawContent : HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Content-Length: 1256
Illustrative output — exact values vary by system and data.
Runbooks
Official sources