@@ -202,7 +202,7 @@ Task SetupHelpForTests {
202
202
203
203
$installHelpScript = {
204
204
param (
205
- [Parameter (Mandatory )][string ]$helpPath
205
+ [Parameter (Position = 0 )][string ]$helpPath
206
206
)
207
207
$PSVersion = $PSVersionTable.PSVersion
208
208
$ErrorActionPreference = ' Stop'
@@ -242,7 +242,6 @@ Task SetupHelpForTests {
242
242
$updateHelpParams .' Scope' = ' CurrentUser'
243
243
}
244
244
# Update the help, and capture verbose output
245
- Wait-Debugger
246
245
$updateHelpOutput = Update-Help @updateHelpParams * > & 1
247
246
248
247
if ((Get-Help Invoke-RestMethod ).remarks -like ' Get-Help cannot find the Help files*' ) {
@@ -255,27 +254,26 @@ Task SetupHelpForTests {
255
254
# Need this to inject the help file path, since PSScriptRoot won't work inside the script
256
255
$helpPath = Resolve-Path " $PSScriptRoot \test\PowerShellEditorServices.Test.Shared\PSHelp" - ErrorAction Stop
257
256
Write-Host - Fore Magenta " Runner Help located at $helpPath "
258
- $resolvedScript = $installHelpScript -replace ' {{HELPPATH}}' , $helpPath
259
257
260
258
if (Get-Command powershell.exe - CommandType Application - ea 0 ) {
261
259
Write-Host - Fore Magenta ' Checking PowerShell 5.1 help'
262
- powershell.exe - NoProfile - NonInteractive - Command $resolvedScript - args $helpPath
260
+ & powershell.exe - NoProfile - NonInteractive - Command $installHelpScript - args $helpPath
263
261
if ($LASTEXITCODE -ne 0 ) {
264
262
throw ' Failed to install PowerShell 5.1 Help.'
265
263
}
266
264
}
267
265
268
266
if ($PwshDaily -and (Get-Command $PwshDaily - ea 0 )) {
269
267
Write-Host - Fore Magenta " Checking PWSH Daily help at $PwshDaily "
270
- & $PwshDaily - NoProfile - NonInteractive - Command $resolvedScript - args $helpPath
268
+ Invoke-BuildExec { & $PwshDaily - NoProfile - NonInteractive - Command $installHelpScript - args $helpPath }
271
269
if ($LASTEXITCODE -ne 0 ) {
272
270
throw ' Failed to install PowerShell Daily Help.'
273
271
}
274
272
}
275
273
276
274
if ($PSEdition -eq ' Core' ) {
277
275
Write-Host - Fore Magenta ' Checking Runner Pwsh help'
278
- & ([ ScriptBlock ]::Create( $resolvedScript )) $helpPath
276
+ & $installHelpScript $helpPath
279
277
}
280
278
}
281
279
0 commit comments