- Notifications
You must be signed in to change notification settings - Fork 25.2k
/
Copy pathEnableDumps.ps1
26 lines (22 loc) · 772 Bytes
/
EnableDumps.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
param(
[Parameter(Position=0,mandatory=$true)]
$application,
[Parameter(Position=1,mandatory=$true)]
$location
)
$werHive="HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting";
$ldHive="$werHive\LocalDumps";
$applicationHive="$ldHive\$application";
if (!(Test-Path$ldHive))
{
New-Item-Path $werHive-Name "LocalDumps";
}
if (!(Test-Path$applicationHive))
{
New-Item-Path $ldHive-Name $application;
}
New-ItemProperty$applicationHive-Name "DumpFolder"-Value $location-PropertyType "ExpandString"-Force;
# Allow maximum 5 dumps
New-ItemProperty$applicationHive-Name "DumpCount"-Value 5-PropertyType "DWORD"-Force;
# 2 - Full Dump
New-ItemProperty$applicationHive-Name "DumpType"-Value 2-PropertyType "DWORD"-Force;