Reply to Message

View discussion in a popup

Replying to:
glowery
Enthusiast
Enthusiast

Creating a Scheduled Task for a VM

Currently I know how to create a task for a VM for a scheduled  recurring nightly task through the Web client, but I can't seem to figure out a way to create a task via PowerCLI.  Hopefully I'm just missing something really obvious.

Ultimately what I'd like to do is be able to something like search for a VM using Get-VM -VM $vmname and pipe that to return any scheduled tasks that vm has and if it currently doesn't have one then I'd love to be able to set a new task. In the context of my current use case, just simply scheduling a nightly reboot.

Sorry if I'm just missing something obvious, I'm just starting to dive into PowerCLI and loving what I can do so far.

Thanks!