Product: PowerShell Universal
Version: 5.0.12
I’m still extremely new to PowerShell Universal and I’m trying to get a handle on things still but the below seems like it should be pretty straight forward but isn’t working as expected. A simple Endpoint is created with a variable URL in a persistent environment.
New-PSUEndpoint -Url "/test/:test" -Method @('GET') -Endpoint {
return $test
} -Environment "Exchange"
Executing the following Invoke-RestMethod returns ‘testvalue1’ as expected
Invoke-RestMethod -uri 'https://localhost:5000/test/testvalue1' -method GET
Running the same command again with a value of testvalue2 returns ‘testvalue1’ again however. Nothing entered as a value for ‘test’ variable is returned. Its always the first value that was submitted until the environment is restarted.
Am I misunderstaing or just doing something wrong?
I’ve tried using parameters, submitting as Body isntead of Variable URL and nothing I seem to do will ever overwrite the first submitted value to the endpoint.