Skip to content

Commit 3a31a0d

Browse files
committed
Try using Set-Variable to set DSCMachineStatus
1 parent 5e6e619 commit 3a31a0d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.vscode/analyzersettings.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
'PSUseApprovedVerbs'
3434
'PSUseCmdletCorrectly'
3535
'PSUseOutputTypeCorrectly'
36-
#'PSAvoidGlobalVars'
36+
'PSAvoidGlobalVars'
3737
'PSAvoidUsingConvertToSecureStringWithPlainText'
3838
'PSAvoidUsingPlainTextForPassword'
3939
'PSAvoidUsingUsernameAndPasswordParams'

source/Classes/020.SqlRSSetup.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ class SqlRSSetup : ResourceBase
506506
#>
507507
if ($this.ForceRestart -or ($exitCode -eq 3010 -and -not $this.SuppressRestart))
508508
{
509-
$global:DSCMachineStatus = 1
509+
Set-Variable -Name 'DSCMachineStatus' -Value 1 -Scope 'Global'
510510
}
511511
}
512512

0 commit comments

Comments
 (0)