Powershell terminal entries do not run if the script contains a #Required directive
I started using Devolutions RDM recently and have been adding some of my commonly-used scripts as PowerShell terminal (local) entries, but I've discovered that RDM will not run any script that includes a #Requires directive, e.g.
#Requires -Modules ExchangeOnlineManagement or #Requires -RunAsAdministrator
If such a directive is included in the script, the entry will silently fail when configured for tabbed mode. If set to run in external mode, an exception error dialog is immediately shown when the entry is run:
ArgumentOutOfRangeException - startIndex ('-1') must be a non-negative value. (Parameter 'startIndex')
Actual value was -1.

Is this a bug or is there a configuration change I can make? I did send an error report if that helps.
Hello James,
It appears that #Requires -Modules currently supports only the hashtable format. As a workaround, you can modify your script to use this format. For more details, see the about Requires - Modules Documentation. Support for simple module names will be added in a future update.
Regarding #Requires -RunAsAdministrator, it currently fails to launch with elevated privileges. As a workaround, use the Classic terminal with “Run as Administrator” enabled. This should allow the script to run correctly until the fix is released.
A ticket has been opened to address these issues, and we’ll keep you informed as progress is made.
Best regards,
Maxime
Thanks, this is great info. Having full support for these directives is ideal but being able to work around both scenarios in the meantime is very helpful.