Last active
November 4, 2015 20:55
-
-
Save JohnL4/d9c5a581646dcc0ab6db to your computer and use it in GitHub Desktop.
In PowerShell, dump a dictionary out to the console formatted as a table of key-value rows, with automatic column width and long text wrapped w/in the column
This file contains 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
$(curl -uri https://rubygems.org/gems/jekyll-feed).Headers | ft -auto -wrap | |
<# | |
$(cmd) is PowerShell's equivalent of bash's backtick command interpolation (`cmd`). | |
"curl" is a built-in alias for Invoke-WebRequest. | |
The result of $(cmd) is an object (PowerShell pipes objects, not text), so | |
".Headers" selects that object property. | |
The Headers property is a dictionary, so we feed that into Format-Table (built-in alias "ft"), | |
specifying auto-width and text-wrapping. | |
#> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment