Skip to content

Commit 312caaa

Browse files
committed
Swap management for utility command and ensure help is cached.
1 parent ecca1de commit 312caaa

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

test/PowerShellEditorServices.Test.Shared/SymbolDetails/SymbolDetails.ps1

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Get-Process -ComputerName "test-computer"
1+
Write-Host -ForegroundColor Black 'Test'
22

33
<#
44
.Synopsis
@@ -10,19 +10,18 @@
1010
.EXAMPLE
1111
Another example of how to use this cmdlet
1212
#>
13-
function Get-Thing
14-
{
13+
function Get-Thing {
1514
[Alias()]
1615
[OutputType([int])]
1716
Param
1817
(
1918
# Param1 help description
20-
[Parameter(Mandatory=$true,
21-
ValueFromPipelineByPropertyName=$true,
22-
Position=0)]
19+
[Parameter(Mandatory = $true,
20+
ValueFromPipelineByPropertyName = $true,
21+
Position = 0)]
2322
$Name
2423
)
25-
24+
2625
Begin
2726
{
2827
}

test/PowerShellEditorServices.Test/Language/SymbolsServiceTests.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -756,13 +756,18 @@ public async Task FindsReferencesOnEnumMember()
756756
[Fact]
757757
public async Task FindsDetailsForBuiltInCommand()
758758
{
759+
// Ensure help is updated prior to test run
760+
await psesHost.ExecutePSCommandAsync(
761+
new PSCommand().AddScript("Update-Help Microsoft.Powershell.Utility -SourcePath $PSHOME"),
762+
default);
763+
759764
SymbolDetails symbolDetails = await symbolsService.FindSymbolDetailsAtLocationAsync(
760765
GetScriptFile(FindsDetailsForBuiltInCommandData.SourceDetails),
761766
FindsDetailsForBuiltInCommandData.SourceDetails.StartLineNumber,
762767
FindsDetailsForBuiltInCommandData.SourceDetails.StartColumnNumber,
763768
CancellationToken.None);
764769

765-
Assert.Equal("Gets the processes that are running on the local computer.", symbolDetails.Documentation);
770+
Assert.Equal("Writes customized output to a host.", symbolDetails.Documentation);
766771
}
767772

768773
[Fact]

0 commit comments

Comments
 (0)