Jump to content

Having trouble running any PS commands/scripts using Automate


merritt.bishop
 Share

Recommended Posts

I feel like I am missing something simple here. I cannot get any PS scripts or commands to execute on client machines from the Pulseway Dashboard. I began by making some simple cache clearing scripts I need to run daily/weekly, and quickly realized those as well as many scripts from my predecessor in the Dashboard were simply not working (folders marked for deletion were still present). In testing, I am now trying to run something as simple as "Restart-Computer" and when ran from the Dashboard (Systems > SystemName > Scripts) it shows as if it ran successfully, but the machine does not reboot. Of course running this command in a non elevated PS prompt directly on the machine results in a reboot as intended. I have tried setting ExecutionPolicy to "Unrestricted" with no change. Batch scripts are working fine, sending a "shutdown /r" results in the intended reboot as well. What could be stopping these PS commands from running on my machines? These are non domain Windows 10 PCs with the most current update and my test ones are single user local admin, so a pretty simple setup.

Link to comment
Share on other sites

  • 3 weeks later...

@merritt.bishop There shouldn't be anything special you need to do.  Without seeing your code, I can't tell you for sure, but my guess is unfortunately you're missing something in your code. 

For instance, I have no trouble doing a computer reboot from Pulseway using PowerShell, however, you have to add -force at the end to get it to do so.

Restart-Computer -ComputerName "$env:ComputerName" -Force

Works like a charm.   Happy to help with other items if you need it. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...