Saltar al contingut principal
  1. Aneu a Scripts.
  2. Creeu un script amb els detalls següents:
    • Nom: Install-Slide
    • Contingut:
# Download the Slide installer
Write-Output "Downloading Slide installer..."
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$client = New-Object System.Net.WebClient
$client.DownloadFile("https://slide.tech/agent", "C:\Windows\Temp\SlideAgent.exe")

# Install Slide agent silently
Write-Output "Installing Slide agent silently..."
Start-Process -FilePath "C:\Windows\Temp\SlideAgent.exe" -ArgumentList "/S" -Wait -NoNewWindow

# Wait a moment for the installation to complete
Start-Sleep -Seconds 10

# Check if the installation was successful
if (Test-Path "C:\Program Files\Slide\Agent\SlideAgent.exe") {
    Write-Output "Slide agent installed successfully"
    
    # Retrieve the pairing code and clean up ANSI color codes
    Write-Output "Retrieving pairing information:"
    $infoOutput = & "C:\Program Files\Slide\Agent\SlideAgent.exe" info
    
    # Extract just the pairing code line and remove ANSI color codes
    $pairingLine = $infoOutput | Where-Object { $_ -match "Pairing Code" }
    if ($pairingLine) {
        # Remove ANSI color codes and extract just the code
        $pairingCode = $pairingLine -replace '\x1B\[[0-9;]*[a-zA-Z]', '' -replace '.*\|\s*', ''
        Write-Output "Pairing Code: $pairingCode"
    } else {
        # If we can't find the specific line, just display all output without color codes
        $cleanOutput = $infoOutput -replace '\x1B\[[0-9;]*[a-zA-Z]', ''
        Write-Output $cleanOutput
    }
    
    exit 0
} else {
    Write-Output "Installation may have failed - SlideAgent.exe not found"
    exit 1
}
  1. Executeu l’script contra un actiu del qual vulgueu fer còpia de seguretat.
  2. Utilitzeu el codi d’aparellament via https://console.slide.tech/agents.