Invoke-WebRequest, GET with parameters throws exception

Question:

Need to invoke the following url from PowerShell script:

While invoking exception thrown as “An error has occurred.”
PowerShell script:

Same exception was thrown while checking this url with Postman.

C# API code:

Route configuration code:

Working fine while calling from C#:

Please help me to invoke this url from PowerShell script.

Answer:

The Url is invalid. “http://hostName:portNumber/test/schedule-process/22/true”. Please use a valid URL.

Source:

Invoke-WebRequest, GET with parameters throws exception by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply