Skip to content

Commit efaf129

Browse files
address misc feedback
1 parent ea965c2 commit efaf129

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

module/PowerShellEditorServices/Commands/PowerShellEditorServices.Commands.psd1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ FunctionsToExport = @('Register-EditorCommand',
7777
'Out-CurrentFile',
7878
'Join-ScriptExtent',
7979
'Test-ScriptExtent',
80+
'psedit',
8081
'Open-EditorFile')
8182

8283
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.

module/PowerShellEditorServices/Commands/Public/CmdletInterface.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function Unregister-EditorCommand {
8080
function Open-EditorFile {
8181
param([Parameter(Mandatory=$true)]$FilePaths)
8282

83-
dir $FilePaths | where { !$_.PSIsContainer } | % {
83+
Get-ChildItem $FilePaths -File | ForEach-Object {
8484
$psEditor.Workspace.OpenFile($_.FullName)
8585
}
8686
}

src/PowerShellEditorServices/Session/RemoteFileManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ public class RemoteFileManager
8282
";
8383

8484
private const string RemovePSEditFunctionScript = @"
85-
if ((Test-Path -Path 'function:\global:Open-EditorFile') -eq $true)
85+
if (Test-Path -Path 'function:\global:Open-EditorFile')
8686
{
8787
Remove-Item -Path 'function:\global:Open-EditorFile' -Force
8888
}
8989
90-
if (Get-Alias psedit)
90+
if (Test-Path -Path 'alias:\psedit')
9191
{
92-
Remove-Alias psedit
92+
Remove-Item -Path 'alias:\psedit' -Force
9393
}
9494
9595
Get-EventSubscriber -SourceIdentifier PSESRemoteSessionOpenFile -EA Ignore | Remove-Event

0 commit comments

Comments
 (0)