Windows Scheduled Tasks Azure DevOps Extension
This [Azure DevOps (i.e. TFS) extension][ExtensionInAzureDevOpsMarketplaceUrl] provides Build and Release Pipeline tasks that allow Windows Scheduled Tasks to easily be installed, uninstalled, enabled, disabled, started, and stopped on the local or remote computer(s).
- Install a Windows Scheduled Task by specifying properties inline, XML inline, or from an XML file.
- Replace an existing Windows Scheduled Task of the same name by overwriting it.
- Enable, Disable, Start, Stop, and Uninstall a Windows Scheduled Task.
- Supports wildcards for modifying many Schedules Tasks easily, or when you only know part of the Scheduled Task's name.
- Multiple computers can be specified to easily run the task against all of them.
- Supports connecting to remote computers via WinRM using many authentication options, such as [CredSSP][CredSspDocumentationUrl], as well as both HTTP and HTTPS.
The computer that will be hosting the Windows Scheduled Task must meet the following minimum requirements:
- Be running Windows 8 or Windows Server 2012 or higher ([the PowerShell cmdlets used by this task][PowerShellScheduledTasksDocumentationUrl] were introduced in these versions).
If the Windows Scheduled Task is on a remote computer, it must also meet these requirements:
- Have Windows Remote Management 3.0 or later installed, as Windows PowerShell uses WinRM to connect to remote computers.
- You may need to enable PowerShell Remoting on the remote computer by running
Enable-PSRemoting from an administrator PowerShell command prompt on the remote computer.
For more information, [read Microsoft's documentation][PowerShellRemotingRequirementsDocumentationUrl].
Authentication options for connecting to a remote computer
All authentication mechanisms supported by [the
Invoke-Command PowerShell cmdlet][PowerShellInvokeCommandCmdletDocumentationUrl] are supported, such as Basic, CredSSP, Digest, Kerberos, Negotiate, and NegotiateWithImplicitCredential.
If you are connecting to a remote computer and want to use CredSSP, it must have CredSSP enabled on it. You can do this by running the following command from an administrator PowerShell command prompt on the remote computer:
Enable-WSManCredSSP -Role Server -Force
More information about the authentication types [can be found here][WinRmAuthenticationDocumentationUrl].
Defining the Scheduled Task definition properties
When installing a Scheduled Task, you have a few different options for how to define the Scheduled Task properties.
Reasons you may want to define all of the properties
Inline in the Build/Release task:
- Convenience and ease of use; no need to generate XML.
- No need to include an XML file in your source control or build artifacts for the deployment to use.