daknetworks.com

You are here: Blog wget / invoke-webrequest | powershell

wget / invoke-webrequest | powershell

The wget command in powershell might give an error. Try this:
(note that this is a bios update file from Dell official web site)

PS>wget https://dl.dell.com/FOLDER05650607M/1/O9020A25.exe -outfile "O9020A25.exe"

The output is an error:

wget : Access Denied
You don't have permission to access

This is because the server has a robots.txt file that refuses powershell useragent. The default useragent for powershell is:

([Microsoft.PowerShell.Commands.PSUserAgent]::InternetExplorer)

To fix, specify the USERAGENT, like so:

PS>wget https://dl.dell.com/FOLDER05650607M/1/O9020A25.exe -outfile "O9020A25.exe" -UserAgent "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

Contact Dak Networks

We are not taking on new clients at this time.