Yes, I already wrote something titled almost identically.
No it’s not a duplicate!
Last time I had you download a .nupkg, unpack it, then push the files to Nano and run a PowerShell script.
This time you can do the install right at the Nano remote prompt - no preparatory steps and no file copy. In addition, it works on Nano TP5 - which still has some challenging limitations that should be eliminated in the RTM version.
Note: the chocolatey package identifier for this port of OpenSSH was updated from “win32-openssh” to just “openssh” on 9/22/2016.
- At a remote prompt into a Nano machine, run:
Install-PackageProvider NuGet -forcebootstrap -force
- Then run (provider MUST BE “nuget”):
Register-PackageSource -name chocolatey -provider nuget -location http://chocolatey.org/api/v2/ -trusted
- Then run:
Install-Package openssh -provider NuGet
- Then run:
cd "$((dir "$env:ProgramFiles\nuget\packages\openssh*\tools" |select -last 1).fullname)"
- And finally (both dots are needed):
How Does This Enable Running The Code Directly On Nano?
We are taking advantage of the fact that Chocolatey Packages are really just specialized NuGet packages. Since Nano TP5 has an operational ‘NuGet’ package provider, it is capable of downloading and extracting the .nupkg - that’s exactly the minimum we need to prepare for calling “barebonesinstaller.ps1” to install on Nano.
You can also put all the above lines into a script block and call it against may Nano instances using Invoke-Command.
Completely Offline Installs
The package still supports completely offline installs for scenarios where you might need it. Read here for more details on how the package can be used: https://github.com/DarwinJS/ChocoPackages/blob/master/openssh/readme.md