How to Silently Install Cycle on a Test Agent Using PowerShell
Cycle can be silently installed on your test agents without the need to launch and interact with the Cycle installer application. This is very useful for installing on test agents or other machines when interacting with a desktop installer is not convenient.
The PowerShell script below can be used to download and install the latest version of Cycle on a Windows based device.
This PowerShell script must be run in a shell with administrative access to successfully install Cycle.
- ## Install Cycle 2.* - latest
- # Import the BITS module
- Import-Module BitsTransfer
- # Declaring variables for Cycle 2.* download and install.
- $CycleInstallURL = "https://cyclelabs.io/get-cycle"
- $cycleExecutable = "install-cycle.exe"
- $BlobDestination = "C:\Temp\$cycleExecutable"
- # Prep staging folder
- New-Item 'C:\Temp' -ItemType directory -Force
- # Download Cycle 2.* with BITS Transfer
- Write-Host "Downloading $CycleInstallURL"
- Start-BitsTransfer -Source $CycleInstallURL -Destination $BlobDestination -DisplayName "Cycle Installation"
- # Check if the file is downloaded
- if (-not (Test-Path $BlobDestination)) {
- Write-Host "Error: Cycle installer not downloaded successfully. Exiting script."
- exit 1 # Exit script with error code 1
- }
- # Install Cycle Automation silently
- $Installer = "C:\Temp\$cycleExecutable"
- Write-Host "Installing Cycle Automation"
- Start-Process -FilePath $Installer -Args "/S" -Verb RunAs -Wait
- Start-Sleep -Seconds 15
- Write-Host "Cycle Automation has been installed"
- # Set Cycle into path.
- $cycleHome = "C:\Program Files (x86)\CycleLabs\Cycle\"
- [System.Environment]::SetEnvironmentVariable("PATH", $Env:Path + ";${cycleHome}", "Machine")
- $Env:Path += ";${cycleHome}\"
- Write-Host "Cycle folder added into path"
- # Remove Cycle installer to free up disk space
- Get-ChildItem "C:\Temp" -Include *.exe -Recurse | Remove-Item
- Write-Host "Cycle installer has been removed from C:\Temp"
Related Articles
Running Tests with Cycle-CLI Command Line Interface
Problem Running tests using the full Cycle client is not always practical, especially when combining Cycle Tests with a Continuous Integration or Continuous Testing process. Solution Cycle has the ability to run from the command line using Cycle-CLI. ...
How to Server Tune Cycle-CLI
The Cycle application provides the ability to input additional JVM parameters to tune how Cycle runs. This ability to tune Java parameters allows you to do things such as set the maximum memory heap size allocated to the Cycle Java process or specify ...
How To Post Jenkins Pipeline Results from the Cycle Appliance to Slack
The Cycle Appliance provides a platform that facilitates continuous testing and continuous integration through cloud-based infrastructure running Jenkins in Azure. A key aspect of continuous testing and continuous integration is giving your ...
Are There Prerequisites to Deploy the Cycle Appliance?
The Cycle Appliance provides a platform that facilitates continuous testing and continuous integration through cloud-based infrastructure running Jenkins in Azure. The main objective of the Cycle Appliance is to make getting started with these ...
How To Update Jira Statuses With Jenkins Pipeline In Cycle Appliance
The Cycle Appliance provides a platform that facilitates continuous testing and continuous integration through cloud-based infrastructure running Jenkins in Azure. A key aspect of continuous testing and continuous integration is giving your ...