How to run a PowerCLI script as Scheduled Task

Easy to answer for the scripting Gurus, a challenge for part time scripter 🙂

How the heck can I run a PowerCLI script triggered by a scheduled Task?

The answer is really easy! Just add this line at the beginning of your script that you want to schedule:

add-pssnapin VMware.VimAutomation.Core

PowerCLI scheduled Task

With this command, the PowerCLI snapins are loaded – and your script works like a charm!

 

Leave a Comment

Your email address will not be published. Required fields are marked *