Im trying to use psremote sessions to execute long running code or high cpu usage code on remote devices but so far when I attempt to do this the job hangs until it timesout. Running the same code in a pwsh terminal works without issue.
I got the Posh-SSH module working fine but was hoping someone had some way of making psremote sessions work as I’d rather use something native to powershell and built around powershell
Depending on your setup. But in most cases you would need to create a variable secret to store you network username password which works fine in normal ps session. Then on your dashboard page store the creds into a $cache variable then when you invoke-command on the computer pass the credentials and it should work just fine.
I also like to run jobs passing the machine name to the job. Just read documentation everything is in there like using an app token. If you need more shout but this should solve it for you
I’m using credentials stored in the secret vault and works like a charm. You could even then look at running these as jobs passing the parameters from the dashboard component. Then you can return the data once the job is complete.
I made new-udspinner years ago but been using these to animating the loading stage and then sync-udelement once the data is ready to display