Skip to content

Instantly share code, notes, and snippets.

@hpaul-osi
Last active October 4, 2017 19:34
Show Gist options
  • Save hpaul-osi/2568f57a1179e6a3b07bdd86bc669027 to your computer and use it in GitHub Desktop.
Save hpaul-osi/2568f57a1179e6a3b07bdd86bc669027 to your computer and use it in GitHub Desktop.
Enable WER
Configuration EnableWER
{
param(
[System.String]
$NodeName = 'localhost',
[System.String]
$DumpFolder = ''
)
Import-DSCResource -ModuleName 'PSDesiredStateConfiguration'
Node $NodeName
{
if('' -eq $DumpFolder -or $null -eq $DumpFolder)
{ $DumpFolder = "$Env:USERPROFILE\DumpFiles" }
$WERRegistryKey = 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps'
Registry "$WERRegistryKey\DumpFolder"
{
Ensure = 'Present'
Key = $WERRegistryKey
ValueData = $DumpFolder
ValueName = 'DumpFolder'
ValueType = 'ExpandString'
}
Registry "$WERRegistryKey\DumpCount"
{
Ensure = 'Present'
Key = $WERRegistryKey
ValueName = 'DumpCount'
ValueData = 2
ValueType = 'DWORD'
}
Registry "$WERRegistryKey\DumpType"
{
Ensure = 'Present'
Key = $WERRegistryKey
ValueName = 'DumpType'
ValueData = 2
ValueType = 'DWORD'
}
Registry "$WERRegistryKey\DontShowUI"
{
Ensure = 'Present'
Key = $WERRegistryKey
ValueName = 'DontShowUI'
ValueData = 1
ValueType = 'DWORD'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment