Compartilhar via


How to edit local and remote files on Nano Server

PowerShell ISE makes it easy to edit local or remote files without opening additional ports on the remote Nano Server.

  1. Connect to Nano Server remotely.

    To access Nano Server remotely, please follow the steps in How to access Nano Server.

    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.

  2. To edit a local file

    Just pass the file’s relative or absolute path to the psEdit command in PowerShell ISE (psEdit is not supported in non-ISE versions of PowerShell.)

    psEdit C:\Windows\Logs\DISM\dism.log
    

    or

    psEdit .\myScript.ps1
    
  3. To edit a remote file.

    Access Nano Server remotely:

    Enter-PSSession –ComputerName "192.168.0.100" -Credential ~\Administrator
    

    Once you’re in the remote session, pass the file's relative or absolute path to the psEdit command:

    psEdit C:\Windows\Logs\DISM\dism.log