I've noticed a strange behavior with Invoke-RestMethod, where the last period of the -Uri
parameter is truncated.
For example:
Invoke-RestMethod -Method Get -Uri http://example.com/this.
Looking at Fiddler, the request goes to http://example.com/this
where the last period is removed.
What is puzzling is that this behavior is only present when running the method on PowerShell, but not on PowerShell ISE. Both PowerShell and PowerShell ISE are using the same engine version.
Major Minor Build Revision
----- ----- ----- --------
5 1 16299 547
Someone mentioned this phenomenon here, but it was never answered. I tried to encode the string using UriBuilder
but the issue is still present. What could be happening here??