Created
July 25, 2017 13:23
-
-
Save DanielSSilva/5496d7e466c4089e02e22bfcba42a30a to your computer and use it in GitHub Desktop.
Powershell script to get the files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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