Copying Files Over a PSSession
I recently bought a Raspberry Pi 3, and now that it’s running Windows IoT Core, I wanted to make it do something. So I wrote a basic UWP App and I was looking for a way to deploy it to the device. Luckily, WinRM is enabled on Windows IoT Core. This allowed me to use PowerShell to remote into the device and copy my appx package.
net start WinRm $ip = "18.104.22.168" Set-Item WSMan:\localhost\Client\TrustedHosts -Value $ip -Force $PWord = ConvertTo-SecureString –String "p@ssw0rd" –AsPlainText -Force $Credential = New-Object –TypeName System.Management.Automation.PSCredential ` –ArgumentList "$ip\Administrator", $PWord $session = New-PSSession -ComputerName $ip -Credential $Credential Copy-Item -ToSession $session ` -Path "C:\Users\brise\Downloads\worker.appx" ` -Destination "C:\Data\Users\Administrator\Documents"