Skip to content

Commit 98b2e14

Browse files
authored
Only search for functions in Constrained Language help tests (PowerShell#9301)
Only search for functions in Constrained Language help tests ## PR Context Searching for only functions is faster
1 parent f5fc053 commit 98b2e14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ try
7979
Import-Module -Name $trustedModuleName1 -Force -ErrorAction Stop;
8080
"@
8181
$command += @'
82-
$null = help NestedFn1 2> $null;
82+
$null = help -Name NestedFn1 -Category Function 2> $null;
8383
$result = Get-Command NestedFn1 2> $null;
8484
return ($result -ne $null)
8585
'@
@@ -1003,7 +1003,7 @@ try
10031003
$scriptModuleName = "UntrustedModuleScriptBlockTest"
10041004
$scriptModulePath = Join-Path $TestDrive ($scriptModuleName + ".psm1")
10051005
@'
1006-
function RunScriptBlock {{
1006+
function RunScriptBlock {{
10071007
$sb = (Get-Command -Name {0}).ScriptBlock
10081008
10091009
# ScriptBlock trusted function, TrustedFn, is dot sourced into current scope

0 commit comments

Comments
 (0)