Suppose, for whatever reason, you need to know your ISP assigned IP address.
Generally you’d launch a browser to do this, using a site like WhatIsMyIP
You can get that information using this handy expression:
You should get the following, outputting your IP address. This assumes you are connected to the Internet.
Curl is of course an alias for Invoke-WebRequest
Putting the expression in brackets so that we can access the Content property makes it easier to access the relevant information.
To get the raw response, execute the following:
You should see the following:
We don’t need everything here – all we need is the content, hence the simplified expression above.