PowerStig icon indicating copy to clipboard operation
PowerStig copied to clipboard

Update the Windows Feature Rule parser to remove the external Data file

Open athaynes opened this issue 7 years ago • 1 comments

Is your feature request related to a problem? Please describe.

The Get-WindowsFeatureName function in the WindowsFeatureRule module does not take advantage of the switch statement regex capability nor do the regex patterns leverage capturing groups.

Describe the solution you'd like

The switch statement should be updated to use regex more efficiently or removed all together and replaced with a single regex with a capturing group. Updating the switch using the following example and move all naming correction in the rest of the switch to a separate task.

switch -Regex ($checkContent -split '\n')
{
    $regularExpression.WindowsFeatureName { $windowsFeatureName += $matches['featureName']}
}

Describe alternatives you've considered

Additional context

athaynes avatar Dec 17 '18 13:12 athaynes

That has been started in PR #206 but still has a bit of clean up and consolidation that needs to happen before it is closed.

athaynes avatar Jan 17 '19 12:01 athaynes