Problem scenario
You use invoke-webrequest and it works fine with some websites. But sometimes you find that PowerShell says “command not found.” What is wrong?
Solution
invoke-webrequest will work to download html and htm files. Depending on the source file on the web server, the command needs a flag to work properly. For an image file with a .jpeg extension, the invoke-webrequest needs a flag “-ContentType ‘image/jpg'” or something similar to work.
…