Skip to content

Commit

Permalink
fixed bool composite issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bcwilhite committed Aug 30, 2021
1 parent 6083e13 commit 7fa5978
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@
## [Unreleased]

* Fixed: Windows Server 2019 V2R1 V-205763 generating an exception [#827](https://github.com/microsoft/PowerStig/issues/827)
* Fixed: PowerSTIG should honor Boolean with all composite resources [#969](https://github.com/microsoft/PowerStig/issues/969)

## [4.10.0] - 2021-08-20

Expand Down
5 changes: 4 additions & 1 deletion source/DSCResources/Resources/Vsphere.VmHostService.ps1
Expand Up @@ -5,12 +5,15 @@ $rules = $stig.RuleList | Select-Rule -Type 'VsphereServiceRule'

foreach ($rule in $rules)
{
$ruleRunning = $null
[void][bool]::TryParse($rule.Running, [ref] $ruleRunning)

VmHostService (Get-ResourceTitle -Rule $rule)
{
Name = $HostIP
Server = $ServerIP
Credential = $Credential
Running = $rule.Running
Running = $ruleRunning
Key = $rule.Key
Policy = $rule.Policy
}
Expand Down
Expand Up @@ -64,10 +64,13 @@ foreach ($rule in $rules)
}
}

$ruleForce = $null
[void][bool]::TryParse($rule.Force, [ref] $ruleForce)

UserRightsAssignment (Get-ResourceTitle -Rule $rule)
{
Policy = ($rule.DisplayName -replace " ", "_")
Identity = $identityList
Force = [bool] $rule.Force
Force = $ruleForce
}
}
5 changes: 4 additions & 1 deletion source/DSCResources/Resources/windows.WindowsEventLog.ps1
Expand Up @@ -5,9 +5,12 @@ $rules = $stig.RuleList | Select-Rule -Type WinEventLogRule

foreach ( $rule in $rules )
{
$ruleIsEnabled = $null
[void][bool]::TryParse($rule.IsEnabled, [ref] $ruleIsEnabled)

WindowsEventLog (Get-ResourceTitle -Rule $rule)
{
LogName = $rule.LogName
IsEnabled = [boolean]$($rule.IsEnabled)
IsEnabled = $ruleIsEnabled
}
}
2 changes: 1 addition & 1 deletion source/Module/Rule.Permission/PermissionRule.psm1
Expand Up @@ -20,7 +20,7 @@ class PermissionRule : Rule
{
[string] $Path
[object[]] $AccessControlEntry <#(ExceptionValue)#>
[bool] $Force
[string] $Force

<#
.SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion source/Module/Rule.UserRight/UserRightRule.psm1
Expand Up @@ -23,7 +23,7 @@ class UserRightRule : Rule
[ValidateNotNullOrEmpty()] [string] $DisplayName
[ValidateNotNullOrEmpty()] [string] $Constant
[ValidateNotNullOrEmpty()] [string] $Identity <#(ExceptionValue)#>
[bool] $Force = $false
[string] $Force = $false

<#
.SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion source/Module/Rule.VsphereService/VsphereServiceRule.psm1
Expand Up @@ -20,7 +20,7 @@ class VsphereServiceRule : Rule
{
[string] $Key
[string] $Policy
[bool] $Running
[sring] $Running

<#
.SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion source/Module/Rule.WinEventLog/WinEventLogRule.psm1
Expand Up @@ -17,7 +17,7 @@ using module .\..\Rule\Rule.psm1
class WinEventLogRule : Rule
{
[string] $LogName
[bool] $IsEnabled <#(ExceptionValue)#>
[string] $IsEnabled <#(ExceptionValue)#>

<#
.SYNOPSIS
Expand Down

0 comments on commit 7fa5978

Please sign in to comment.