-
Notifications
You must be signed in to change notification settings - Fork 8
Replace throw with New-InvalidOperationException in DSC_SChannelSettings #68
Copy link
Copy link
Open
Description
Description
Replace the raw throw statement in DSC_SChannelSettings.psm1 (lines 599-600) with New-InvalidOperationException using a localized message.
Changes Needed
-
Add a new localized string key to
source/DSCResources/DSC_SChannelSettings/en-US/DSC_SChannelSettings.strings.psd1:HotfixNotInstalled = 'Hotfix KB3140245 is not installed. Setting these registry keys will not do anything. Please install the hotfix first.'
-
Replace the throw statement in
source/DSCResources/DSC_SChannelSettings/DSC_SChannelSettings.psm1(lines 599-600):# Current: throw ('Hotfix KB3140245 is not installed. Setting these registry keys will not do anything. ' + ` 'Please install the hotfix first!') # Should be: New-InvalidOperationException -Message $script:localizedData.HotfixNotInstalled
Context
MOF-based DSC resources must use New-InvalidOperationException instead of raw throw statements for proper error handling, and all user-facing strings must be localized.
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels