O'Reilly logo

PowerCLI Cookbook by Philip Sellers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Scheduling automatic snapshot remediation

With the function in an established form, you can take and execute the .ps1 file using the Windows Task Scheduler. Creating the scheduled task for a PowerShell requires that you set up some basic things within the .ps1 file that has your function. You will also want to run the function with a given set of parameters for this scheduled task. All of these things can be added into the file.

In order to use a .ps1 file, you will need to change the execution policy and sign your code file. Code signing for PowerShell and PowerCLI adds a trusted digital signature to a file, allowing PowerShell to identify the source and trust the file if the signature is trusted. Code signed with a trusted publisher can be run ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required