Sorry, I know that this questions has been asked before put there was no satisfying answer so I ask again.
How can I restart/reload a single endpoint in PowerShell Universal Server 5? With Restart I mean reload the endpoint (code) from disk again. I have situations where I update endpoint code in the UI and save it. Then I call the endpoint using
Invoke-RestMethod
but it doesn’t reflect the changes.
If I restart the PSU v5 Windows Service it works.
Does PSU 5 cache the endpoint code in memory ?
If yes, wouldn’t a button Reload-Endpoints be a good idea?
I mean in a production environment you cannot just restart a whole PSU because of “cache-clearing”.
I remember that PSU 4 had a “Restart API” button. But in PSU 5 I couldn’t find such things. I looked around in the UI for at least an hour. I would expect such a functionality under the API/Endpoint section.
I have not had this happen, personally - what environment is your API currently running on? If it is using Integrated, try switching to PS7 or PS5. With ours on PS7, we are able to just call the API again after adjusting the code.
Another assumption being made is that you are writing the APIs in PowerShell and not C# - is that correct?
Oh… I found the “Restart”-Button with your help. It was under Environment. How could I miss that !
We use a separate environment “Powershell 7” not the integrated one.
And yes, so far we use Plain PowerShell Code in Endpoints and PSU-Scripts. Not mixing in C# at the moment. But this could happen soon as I am a fan of using C# in PowerShell and Vice-Versa
Will upgrade to 5.6.10 and see if problem still exists. They mention something about the FileSystemWatcher no taking up changes.