How to access Nano Server
Because Nano Server does not support a local session, it must be accessed remotely.
Start an elevated PowerShell ISE session.
You can do this by running the following command from any command line:
RunAs /user:Administrator PowerShell_ISE.exe
Alternatively, you can Ctrl+Shift+Click (or Ctrl+Shift+Double-Click) on the PowerShell ISE icon to start it with elevated (Admin) privileges. The ISE is not strictly required but it makes it easier to edit remote files (using
psEdit
) and remotely debug PowerShell scripts.Set the Trusted Host.
This is a one-time setting for each remote machine. You’re basically telling your development machine to trust the remote Nano Server.
Set-Item WSMan:\LocalHost\Client\TrustedHosts "192.168.0.100" # replace with your Nano Server's IP address
If this is a safe development environment, and you don't want to set the trusted host for each remote machine individually, you can just enter:
Set-Item WSMan:\LocalHost\Client\TrustedHosts *
Start the session.
Enter the following commands into the PowerShell ISE command line:
$ip = "192.168.0.100" # replace with your Nano Server's IP address $s = New-PSSession -ComputerName $ip -Credential ~\Administrator Enter-PSSession -Session $s
Having the IP address in a variable will come in handy when you need to copy files to/from your Nano Server. If you prefer brevity, enter the session directly using the following one-liner:
Enter-PSSession –ComputerName "192.168.0.100" -Credential ~\Administrator
Exit the session.
Once you’re all done with your Nano Server, exit the session as follows:
Exit-PSSession