How To AutoMate PowerShell Scripts

by Jonathan Chan, in Ask an ASE, posted 7/31/12
image for article

PowerShell is everywhere. At least, as Microsoft says, anywhere you will find Windows 7 and most Windows Server Systems. It’s been everywhere for quite some time, having been launched into the market nearly six years ago, and having achieved stability with v2.0 in July 2009. Since its stabilization, the Windows market, prompted by Microsoft, has broadened its embrace (just check out all the independent blogs and advice sites) of PowerShell as the successor to prior-Windows scripting approaches (.BAT files, Vbscript, et al.).

PowerShell is at once an interactive command-line-interpreter (CLI) and a scripting language. Individual commands can be sequenced and saved in .PS1 files that can be later fed to PowerShell for execution by its CLI. PS1 files can be stored anywhere, and with the proper sys admin credentials, can be executed anywhere. But how are they executed?

Microsoft assumes a level of sys admin or .PS1 file-owner involvement in the execution of PowerShell scripts. And why not? CLI’s are built with the idea of someone interacting with a keyboard (and maybe a mouse). So when you can group an entire series of commands into a single file (say myscriptfile.ps1) and then type its name into the Run command, isn’t that enhanced productivity? Well, yes, to some extent — but only rudimentarily.

But what about unattended operations? What if I’d like myscriptfile.ps1 to run every day at 5pm? Or to run an entire bank of script files? What about running them upon the arrival of a new data file from an FTP site, or some other condition? What then? What management and control structure does Microsoft provide for PowerShell processing?

For single-machine, clock-based triggering there is WTS (also bundled with Windows 7), but if execution triggers other than time are needed (or integration with data or other technologies is required) sys admins must rely on their own manual monitoring and run command submissions.

Unless you have AutoMate. In this How-To video, we are showing just the basic capabilities of how AutoMate controls the execution of PowerShell commands and scripts. Take a look. And, with your knowledge of AutoMate’s broad Action Library, consider the ways AutoMate can enhance the execution of your organization’s tried and true script library.

 Click here or on the image below to watch the video on automating PowerShell scripts.

How To AutoMate PowerShell Scripts