There are very few PowerShell commands on Windows 10 that allow you to check the weather forecast. However, by using these commands, you can see 'significant' weather changes in your area, such as storms, rain, temperature changes throughout the day, etc. Additionally, you can use PowerShell to view moon phases and get PNG weather forecast images.
Using PowerShell commands to check weather on Windows 10
Step 1: Open PowerShell by typing the keyword into the Search box on the Start Menu or Cortana Search box, then from the search results list, click to open PowerShell (Desktop app).
Step 2: If the User Account Control (UAC) window appears, click Yes to continue.
Additionally, you can pin PowerShell to the Taskbar for convenient access.
Using PowerShell
Step 3: In the PowerShell window, enter the following command line (or you can copy and paste it into PowerShell):
(curl http://wttr.in/?Q0 -UserAgent 'curl' ).Content
Note: In the command above, replace ?Q0 with the location where you want to check the weather forecast.
For example, enter the command below to check the weather forecast in Kolkata:
(curl http://wttr.in/Kolkata -UserAgent 'curl' ).Content
At this point, you will see detailed weather forecasts for the area you searched for.
Step 4: Additionally, you can add the country name after the city name to see the specific weather forecast at that location.
(curl http://wttr.in/'Kolkata,India' -UserAgent 'curl' ).Content
Note that it's important to use the correct commands to avoid potential errors.
Step 5: To check the weather on Windows 10 using PowerShell for a specific location, you can use the following command:
(curl wttr.in/Kolkata?0 -UserAgent 'curl' ).Content
In the command above, replace Kolkata with the location you want to check the weather for.
Step 6: To view a condensed version of the weather forecast, use the command below to check the weather forecast for the evening and night:
(curl wttr.in/Kolkata?n -UserAgent 'curl' ).Content
Step 7: To access weather forecast services on a web browser, enter the following line into the web browser's address bar:
wttr.inX/
Note: Replace X with the location, place you want to check the weather.
Get PNG weather forecast images
Step 8: This is the .png image of the weather forecast when you enter data in the web browser's address bar. Additionally, you can also customize various parameters for the .png image.
wttr.inX/.png
Replace X with the location, place you want to check the weather.
For different parameters on the .png image, this command will be useful:
wttr.in/Location_parameters.png
Step 9: Not only English, this weather service also supports various other languages. To change the language, use the syntax:
(curl wttr.in/Berlin?lang=de -UserAgent 'curl' ).Content
The supported languages by the service will be displayed.
az bg ca cs cy da de el eo es fi fr hi hr hu is it ja ko mk ml nl nn pt pl ro ru sk sl sr sr-lat sv tr uk uz vi zh et hy jv ka kk ky lt lv sw th zu bs be
Use PowerShell to view Moon Phase
Step 10: Additionally, there's another PowerShell command to display the current moon phase. You can use the command below:
(curl wttr.in/Moon -UserAgent 'curl' ).Content
Viewing weather on Windows 10 using PowerShell is one of the useful features on the Windows 10 operating system. You can see how the temperature fluctuates throughout the day and view it in the language of your choice. Additionally, you can also view the moon phase at your location.
In previous articles, we've also shown how to use PowerShell to trim SSD on Windows 10, check SSD on your computer. If interested, you can refer to how to use PowerShell trim SSD on Win 10 here.
Windows Defender is a program designed to protect your computer, preventing threats from outside. However, sometimes it can be bothersome to users. If you wish, you can turn off Windows Defender. The method to disable Windows Defender has been explained in our previous article. Wish you success!
