File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,18 @@ if (!(Get-Module PSScriptAnalyzer) -and !$testingLibraryUsage)
6
6
Import-Module PSScriptAnalyzer
7
7
}
8
8
9
+ # Force Get-Help not to prompt for interactive input to download help using Update-Help
10
+ # By adding this registry key we turn off Get-Help interactivity logic during ScriptRule parsing
11
+ $null , " Wow6432Node" | ForEach-Object {
12
+ try
13
+ {
14
+ Set-ItemProperty - Name " DisablePromptToUpdateHelp" - Path " HKLM:\SOFTWARE\$ ( $_ ) \Microsoft\PowerShell" - Value 1 - Force
15
+ }
16
+ catch
17
+ {
18
+ # Ignore for cases when tests are running in non-elevated more or registry key does not exist or not accessible
19
+ }
20
+
9
21
$directory = Split-Path - Parent $MyInvocation.MyCommand.Path
10
22
$message = " this is help"
11
23
$measure = " Measure-RequiresRunAsAdministrator"
@@ -48,7 +60,7 @@ Describe "Test importing correct customized rules" {
48
60
$customizedRulePath.Count | Should Be 1
49
61
50
62
# Force Get-Help not to prompt for interactive input to download help using Update-Help
51
- # By adding this registry key we force to turn off Get-Help interactivity logic during ScriptRule parsing
63
+ # By adding this registry key we turn off Get-Help interactivity logic during ScriptRule parsing
52
64
$null , " Wow6432Node" | ForEach-Object {
53
65
try
54
66
{
You can’t perform that action at this time.
0 commit comments