Unfortunately, it is not possible to execute external or scheduled scripts written in Powershell directly. If Powershell is directly invoked, it will exit immediately without doing anything.
It is possible to execute external or scheduled scripts written in Powershell indirectly by utilizing the visual basic script psExec.vbs, which in turn executes the Powershell script.
External scripts receive xml on stdin. The xml contains information about the object that is changing and is necessary for the external scripts. psExec.vbs forwards the xml to the Powershell script by writing it to a temporary .xml file, which is then removed once the Powershell script is done.
To execute the Powershell script, copy psExec.vbs and the Powershell script to the M&M Central data directory (usually C:\ProgramData\Men and Mice\Central. See this for alternate locations). Then use the following statement in the System Settings>External Commands
Where it is assumed that there exists an administrative user called "ScriptRunner", with a complex password. Every time the script is run, a new temporary password is generated for the ScriptRunner user, forwarded to the script as the arguments $u and $p (username and password). The forwarded credentials can then be used to invoke e.g. the SOAP API inside of the script.
The Powershell script must have the following parameters declaration (additional parameters can be added, but the three first must be retained)
Scheduled scripts are different from external scripts in that they don't receive any xml on stdin. Therefore psExec.vbs needs to be triggered to not wait for the xml on stdin, which can be done by adding a trailing "n" at the end of the string, i.e.
The Powershell script now only requires two parameters for the username and temporary password