You learn how to copy a file on a Nano Server via PowerShell without wasting any time. Stop looking anywhere else. In this tutorial of Focus on computers we will teach you how to copy files using PowerShell on a Nano Server. If you’re a veteran in the IT world, or you’re more of a novice in Nano Server management, it does not really matter; this article will help you cut through the intricacies of copying files. Thanks to the functionality provided by PowerShell and the simplified beauty of the Nano Server, you will succeed in copying the said files.
It may seem at first that uploading a file to a site and downloading it with PowerShell will solve this issue. Yes that’s right. This is a simple and of course Linux way. When connecting to SSH Linux, you will not be able to send the file directly, but in PowerShell it is possible to copy a file from the host to the destination server, which is the nano server.
Recommended Service: cheap linux vps
Step 1)
First, enter the information needed for the connection or the session in a variable as shown below:
$session = New-PSSession -ComputerName 192.168.0.21 -Credential administrator
In the above command, $session is our variable name and 192.168.0.10 will be the IP address of the Nano Server.
Finally, we have entered the name Administrator as a username.
After entering the above command, enter the following command to copy the file:
Copy-Item C:\VMs\NanoServer\* -Destination c:\files\Nano -recurse -ToSession $session -Verbose
After entering the above command you will copy a file named Michael.txt from C:\VMs\Nanoserver to C:\files\Nano.
Note 1: If you are asked for a password, enter your Nano Server password after entering the above command.
Note 2: The address entered in the nano server that is entered in the Destination section must be pre-created.
You have simply copied the file you want to your nano server.
Conclusion
In this article, we have thoroughly explained how the copying of files on a Nano Server, uses PowerShell in the procedure. Equipped with a clear picture of where the file is, how to move around the file system and memorizing pretty many commands in PowerShell, anyone should be able to move files into one’s own Nano Server.