Closed yobyot closed 5 years ago
Here's an image:
PSEdit only exists inside of the PowerShell ISE or VS Code.
Thanks. I cropped the image -- but if you look closely at the image, at the top you can see the errors are coming from a terminal session inside vscode. The terminal's options are shown at the top of the screen.
@sdwheeler Please reopen this. It's not the user error you think it is.
Then this is not a doc bug, it is an issue with VS Code. Please file an issue at https://github.com/PowerShell/vscode-powershell/issues.
/cc: @TylerLeonhardt
Except that the doc is wrong, since it doesn't work.
It is supposed to work.
If the feature was removed then this is a doc bug. Waiting for response from @TylerLeonhardt.
@yobyot, psedit
only exists in the PowerShell Integrated Console which is the console provided by the, PowerShell extension. From your screenshot, you are using a regular PowerShell console in vscode which does not have psedit
available.
@TylerLeonhardt Thanks.
@sdwheeler Doc should be updated, IMO, to reflect the fact that you must use the integrated console.
PSEdit is a function that exists in the ISE by default. You can replicate this by adding this function definition into the Windows PowerShell Console's $profile:
Function PSEDIT {
[CmdletBInding()]
param([Parameter(Mandatory=$true)]$filenames)
foreach ($filename in $filenames) {
dir $filename |
where {!$_.PSIsContainer} |
%{
start-process $Pshome\powershell_Ise.exe $filename
}
}
}
This does not work with PowerShell 7, but with PowerShell 7, you would be using VS Code. You can always just type Code $filename and it just works! Another reason I like VS Code.
Per conversation with @sdwheeler, there's no way for the non-Integrated Console to be enlightened in VS Code to support psedit
(it reports as an xterm
terminal). To that end, we should doc that behavior and suggest usage of code
as doctordns
pointed out. (That usage of code
would work the same as in any non-Code-hosted terminal
I think the simpler answer is: doc that psedit
must be run in the integrated terminal provided by the PowerShell extension of vscode. That's the doc error, IMHO.
Yes, @sdwheeler please go with @yobyot's suggestion. psedit
does more than what code
does because it works on remote machines that you've Enter-PSSession
'd into from the PowerShell Integrated Console.
Hello,
This would be cool if I could get it to work. Is there something "missing" at the remoted machine (an Ubuntu VM in Azure, very much like what the illustrations show.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.