Display all content with Invoke-WebRequest

Unlike the curl command line utility Invoke-WebRequest returns an object with various properties of which the content of the requested document is just one. You can get the content in a single statement by expanding the property like this:

Invoke-WebRequest 'http://www.example.org/' | Select-Object -Expand Content

or by getting the property value via dot-notation like this:

(Invoke-WebRequest 'http://www.example.org/').Content

Alternatively you could use the Windows port of curl:

& curl.exe 'http://www.example.org/'

Call the program with its extension to distinguish it from the alias curl for Invoke-WebRequest.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)