Created
May 30, 2018 13:49
-
-
Save maldevel/2f44858adf86a321a8c81378e9382b13 to your computer and use it in GitHub Desktop.
Get HTTP headers using PowerShell
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
param( | |
[Parameter(ValueFromPipeline=$true)] | |
[string] $Url | |
) | |
$request = [System.Net.WebRequest]::Create($Url); $headers = $request.GetResponse().Headers; $headers.AllKeys | Select-Object @{ Name = "Key"; Expression = { $_ }}, @{ Name = "Value"; Expression = { $headers.GetValues( $_ )}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment