# Set the path to the speedtest-cli executable $SpeedtestPath = "C:\path\to\speedtest-cli.exe" # Set the path to the CSV file where the results will be stored $CSVPath = "C:\path\to\results.csv" # Loop indefinitely while ($true) { # Run the speedtest-cli and capture the output $SpeedtestOutput = & $SpeedtestPath --csv # Append the output to the CSV file $SpeedtestOutput | Out-File -FilePath $CSVPath -Append # Wait for 5 minutes before running the next speedtest-cli Start-Sleep -Seconds (5 * 60) }