How to Silently Install Cycle on a Test Agent Using PowerShell

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.

  1. ## Install Cycle 2.* - latest

  2. # Import the BITS module
  3. Import-Module BitsTransfer

  4. # Declaring variables for Cycle 2.* download and install.
  5. $CycleInstallURL = "https://cyclelabs.io/get-cycle"
  6. $cycleExecutable = "install-cycle.exe"
  7. $BlobDestination = "C:\Temp\$cycleExecutable"

  8. # Prep staging folder
  9. New-Item 'C:\Temp' -ItemType directory -Force

  10. # Download Cycle 2.* with BITS Transfer
  11. Write-Host "Downloading $CycleInstallURL"
  12. Start-BitsTransfer -Source $CycleInstallURL -Destination $BlobDestination -DisplayName "Cycle Installation"

  13. # Check if the file is downloaded
  14. if (-not (Test-Path $BlobDestination)) {
  15.     Write-Host "Error: Cycle installer not downloaded successfully. Exiting script."
  16.     exit 1  # Exit script with error code 1
  17. }

  18. # Install Cycle Automation silently
  19. $Installer = "C:\Temp\$cycleExecutable"
  20. Write-Host "Installing Cycle Automation"
  21. Start-Process -FilePath $Installer -Args "/S" -Verb RunAs -Wait
  22. Start-Sleep -Seconds 15
  23. Write-Host "Cycle Automation has been installed"

  24. # Set Cycle into path.
  25. $cycleHome = "C:\Program Files (x86)\CycleLabs\Cycle\"
  26. [System.Environment]::SetEnvironmentVariable("PATH", $Env:Path + ";${cycleHome}", "Machine")
  27. $Env:Path += ";${cycleHome}\"
  28. Write-Host "Cycle folder added into path"

  29. # Remove Cycle installer to free up disk space
  30. Get-ChildItem "C:\Temp" -Include *.exe -Recurse | Remove-Item
  31. 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 ...