Answered by:
wget Fail Powershell v5

Question
-
I had a script on PS4 that runs wget -i .\ Urls.txt but on PS5 it tells me this error:
cmdlet Invoke-WebRequest at command pipeline position 1
wget : Invalid URI: The hostname could not be parsed.
Supply values for the following parameters:
Uri:
At line:1 char:1
+ wget -i .\ Urls.txt
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-WebRequest], UriFormatException
+ FullyQualifiedErrorId : System.UriFormatException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Any solutions?
Thanks
Monday, July 24, 2017 10:29 AM
Answers
-
That is correct. You cannot use it and must use full path to WGET utility.
\_(ツ)_/
- Marked as answer by ThorElPoderoso Monday, July 24, 2017 11:24 AM
Monday, July 24, 2017 11:01 AM
All replies
-
Sorry but we don't have that script. Perhaps you can contact the author of your script for help.
\_(ツ)_/
Monday, July 24, 2017 10:43 AM -
Hi JRV
is simple file
wget -i $PathFiles\Urls.txt
Get-ChildItem | Where-Object {$_.name -like "*manager*"} | remove-itemUrl.txt
http://localhost/manager?cmd=reset&from=list1
http://localhost/manager?cmd=reset&from=list2
http://localhost/manager?cmd=reset&from=list3
Monday, July 24, 2017 10:45 AM -
The error message and the script don't match. The code doesn't make any sense. "wget" is not a PowerShell CmdLet it is an alias.
Using localhost may fail. Use the host name and test with a browser or as a command.
Invoke-WebRequest 'http://localhost/manager?cmd=reset&from=list1'
\_(ツ)_/
- Edited by jrv Monday, July 24, 2017 10:52 AM
Monday, July 24, 2017 10:48 AM -
what?
This script in PS4 is ruunnig
- Edited by ThorElPoderoso Monday, July 24, 2017 10:57 AM
Monday, July 24, 2017 10:50 AM -
Invoke-WebRequest dont load multiple lines on txt fileMonday, July 24, 2017 10:58 AM
-
you were using the wget utility. You need to use the full path to the utility or remove the alias.
\_(ツ)_/
Monday, July 24, 2017 10:58 AM -
That is correct. You cannot use it and must use full path to WGET utility.
\_(ツ)_/
- Marked as answer by ThorElPoderoso Monday, July 24, 2017 11:24 AM
Monday, July 24, 2017 11:01 AM -
thanks JRVMonday, July 24, 2017 11:24 AM