If you are using Powershell 5, you can use command called PSEdit. It only works from ISE.
- So first, open PowerShell ISE
- Then open remote session to the remote computer using Enter-PSSession
- Then edit the file using PsEdit ‘filename’
The remote file will be opened in a new tab in your (local) ISE window.
Actually I found this answer from the comments section of this SO question , but I think it will be helpful for others if I post it as answer here.