Add parameter -useBasicParsing

This commit is contained in:
Markus Fleschutz 2021-05-06 20:03:02 +02:00
parent 67cb8ac816
commit 50221e502f
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@
param($RSS_URL = "https://yahoo.com/news/rss/world", [int]$MaxCount = 20)
try {
[xml]$Content = (invoke-webRequest -URI $RSS_URL).Content
[xml]$Content = (invoke-webRequest -URI $RSS_URL -useBasicParsing).Content
"`n🌍 $($Content.rss.channel.title) 🌏"
[int]$Count = 0

View File

@ -8,7 +8,7 @@
param($Location = "") # empty means determine automatically
try {
$Weather = (Invoke-WebRequest http://wttr.in/${Location}?format=j1 -UserAgent "curl" ).Content | ConvertFrom-Json
$Weather = (Invoke-WebRequest http://wttr.in/${Location}?format=j1 -UserAgent "curl" -useBasicParsing).Content | ConvertFrom-Json
$Area = $Weather.nearest_area.areaName.value
$Region = $Weather.nearest_area.region.value