Latest posts by Wolfgang Sommergut (see all)
- Migrate a WSUS database from WID to SQL Server - Mon, Jan 13 2020
- Audit changes in the Windows registry - Wed, Jan 8 2020
- Move WSUS database and content (updates) to a different drive or folder - Wed, Dec 11 2019
To edit a file on a remote computer, you will usually navigate to a network share and load the text into a local editor. Alternatively, you connect via Remote Desktop Protocol (RDP) and use an editor residing on the remote machine.
Interesting option for Nano Server ^
In some cases, these ways are cumbersome or not even possible, for instance, if you have to edit files on a Nano Server. Microsoft's GUI-less operating system doesn't accept remote desktop connections. At least you could access the server's file system through an admin share.
However, PowerShell ISE offers a comfortable alternative with PSEdit. If you are working on a script, you don't have to leave your development environment to edit the file on a remote server.
Starting a remote session via GUI ^
First, you have to open a remote session on the server, which you could do the usual way with the corresponding cmdlets.
However, it is easier just to click New Remote PowerShell Tab in ISE's File menu. A dialog will then open where you just have to enter the computer name of the remote machine and your credentials.
Afterwards, you are in the context of the remote computer where you can navigate through the file system with Set-Location and Get-ChildItem. Once you locate your file, you can open it with PSEdit, which also accepts wildcards:
This command would load all PowerShell scripts from the current directory and open each file in a different tab.
The feature is unavailable on older Windows versions. However, if you upgrade to PowerShell 5.1, you will also get the latest PowerShell ISE version.