Skip to content

Instantly share code, notes, and snippets.

@DanielSSilva
Created July 25, 2017 13:23
Show Gist options
  • Save DanielSSilva/5496d7e466c4089e02e22bfcba42a30a to your computer and use it in GitHub Desktop.
Save DanielSSilva/5496d7e466c4089e02e22bfcba42a30a to your computer and use it in GitHub Desktop.
Powershell script to get the files
$ips = @("192.168.1.90");
$rpiFolder = "/home/pi/Documents";
$destFolder = "F:\DEV\blog\";
$myPiPassword = Get-Content -Path "F:\DEV\blog\myPiPassword.txt"
foreach($ip in $ips){
Write-Host $ip
$scriptBlock = [scriptblock]::Create("pscp -l pi -pw $myPiPassword pi@$($ip):$($rpiFolder)/*.txt $($destFolder)")
Invoke-Command -ScriptBlock $scriptBlock
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment