Can you have a before script cancel loading the session if error?
I have a before open PowerShell script that runs and wondered if there was a way to tell RDM to cancel loading the session? Basically if the script errors I would send command to stop the session from trying to load as it will fail.
Ok think I just found the cancel part `$RDM.Cancel = $true`
This didn't work in a before script.
But still wondered bout this:
Also anyway to use the RDM alert\message popup to inform of the issue?
Thanks!
Hello,
I will verify what can be done. It's certainly a useful and good idea. I'm just not sure if our current implementation can handle the cancellation gracefully.
Regards
David Hervieux
Hello,
I've just tested it and it work fine. Indeed it's documented here:
https://docs.devolutions.net/rdm/kb/how-to-articles/execute-powershell-connection/
What RDM version do you use?
Regards
David Hervieux
Hello,
I've just tested it and it work fine. Indeed it's documented here:
https://docs.devolutions.net/rdm/kb/how-to-articles/execute-powershell-connection/
What RDM version do you use?
Regards
@David Hervieux
Hi David,
Thanks for taking a look. This does work using the before PowerShell script block and docs you show but, using the 'command' before script to call a PowerShell script, these variables are not recognized as far as I can tell. $RDM and $connection.
I did find I was having issues with RDM and the RDM PowerShell cmdlet and followed the docs here and fixed a lot of my issues, as well as turning off `force admin` in the windows terminal. I need to respond to a previous post about this as well.
My question now was how to send a message to the user using the RDM alert system with PowerShell if possible?