Helped me, hoping it may help you or others:
In my case the powershell restrictions was the fault:
1. Check if the powershell path is present and correct (in system variables path)
2. Check if the group policy editor allows to run powershell scripts - this was my issue.
I do not know if I have to expand my answer any further on how to do each step because it can be googled easy. If you want me to explain - I may try :)