0

I'm very new to this sort of stuff so please be patient. This is my problem: I'm trying to run a script on my digital loggers webpage on windows powershell using curl but I keep getting errors, as such.

Invoke-WebRequest : Cannot bind parameter 'Uri'. Cannot convert value
"http://admin:MyPassword@MyIp:MyPort/script?run001=run" to type "System.Uri". Error: "Invalid URI: The hostname
could not be parsed."
At line:1 char:6
+ curl http://admin:MyPassword@MyIp:MyPort/script?run001=run
+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

I'm more than happy to provide whatever information that is necessary

When i run http://admin:MyPassword@MyIp:MyPort/script?run001=run on chrome it runs the script but i cant get it to work on powershell. The whole purpose of this is so I can have control of my outlets on Home Assistant.

Home assistant does not find any devices for digital loggers on the network so i thought i could just run a script to turn on/off the outlet using curl but I'm struggling

6
  • Have you tried these? Commented Mar 5, 2024 at 7:44
  • Question: are you passing MyPort literally? Commented Mar 5, 2024 at 8:42
  • @sirtao i have replaced MyPort with the actual port number if that's what you are asking Commented Mar 5, 2024 at 8:50
  • @codeR i did try those but i might have not fully understood that's why i decided to reach out and ask this question Commented Mar 5, 2024 at 8:53
  • 2
    Note that in PowereShell, curl is an alias for the built-in Invoke-WebRequest cmdlet. If you want to call the stand-alone curl executable you’ll need to use curl.exe to disambiguate it. Commented Mar 5, 2024 at 9:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.