I just wanted to share my experience with this.

Although the VSA documentation for VSA 9.4 indicates that Custom Extensions can be uses to execute PowerShell Scripts, I've found that this does not work as expected. If you upload and execute a PowerShell script, it will only open the script in Notepad. This is apparently by design as the file type association for the scripts is set that way as a security measure to prevent remote code execution.

I did find a work-around though. I found that PowerShell commands can be called from a CMD\BATCH script, which will execute properly from the Custom Extension. For example, I created the following in a CMD script called Uninstall_Facebook.cmd:

powershell -ExecutionPolicy Bypass -command "Get-AppxPackage *Facebook* | Remove-AppxPackage"
EXIT 0
The above script will remove the Facebook app from a default Windows 10 install. Notice the "EXIT 0" line will ensure the cmd window will close after executing.
I hope this was helpful.
- Dean Claypool



Re-corrected line break spcing.
[edited by: deanc911 at 1:38 PM (GMT -7) on Mar 29, 2017]