Hello,
I have the following problem.
I want to customize a user role via Powershell and the MilestonePSTools.
The PS script is running so far and I have created a batch file that runs the PS script.
If I run the batch file directly in Windows, everything works so far.
If I start the batch file via CMD, it also works so far.
However, when I take the BatAction tool and ask a rule to run the bat file, nothing happens.
At first I thought that the rule is not triggered, but then I added a log entry as action and this is also written, so the rule is executed.
If I create a BAT file that sends an HTTP API to a camera via CURL, then that also works via BatAction, it just doesn’t start the Powershell script for me.
In the BAT file I have entered the following:
PowerShell.exe -Command “& ‘[C:\PowerShellHUB\KameraAN.ps1’](file:C:/PowerShellHUB/KameraAN.ps1’)”
Tried also with
PowerShell.exe -ExecutionPolicy Bypass -Command “& ‘[C:\PowerShellHUB\KameraAN.ps1’](file:C:/PowerShellHUB/KameraAN.ps1’)”
When I run this in Windows, it works as well.
Is there anything else I need to take care of here? Rights wise?
So that I can execute the PS-Script via BatAction?
I am grateful for any tip.
Many greetings
Maik