Skip to content
English - United States
  • There are no suggestions because the search field is empty.

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 = "<a href="https://cyclelabs.io/get-cycle" "="" target="_blank" rel="noopener noreferrer">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"