Question
Read the guide here and complete the registration process. You can use their free service, so you don't need to pay anything. This web service
- Read the guide here and complete the registration process. You can use their free service, so you don't need to pay anything.
- This web service requires an API Token. After you sign up, view your default API key here. You will need this key to communicate with the API from PowerShell. (API Token is synonymous with API Key).
Here are the components of the script you should build:
-
Use the Current Weather Data endpoint using ZIP code (30912) and country code (US).
-
You will need to use a custom header [reference1 reference2]. Note there are a couple of ways to do this (2 ways, 2 references). Either will work, just don't mix the two together.
-
The header field name you need to use is token and the value is your API key
-
Save the response of your API call to the variable $weather
-
Pipe $weather to Select-Object -ExpandProperty main to see the current temperature in the temp field in degrees Kelvin. Note that the property main is just the name of the node we care about in the return JSON data.
- The output in your screen shot needs to be clearly labeled so as to see the temperature value and temp field name.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started