This repository has been archived by the owner on Jul 21, 2018. It is now read-only.
/
FixRemediateDriverIssue.ps1
133 lines (121 loc) · 4.26 KB
/
FixRemediateDriverIssue.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
$node = "localhost"
configuration DisableCleanupTask
{
Import-DscResource -ModuleName GraniResource
cScheduleTask PlugAndPlayCleanup
{
Ensure = "Present"
TaskName = 'Plug and Play Cleanup'
TaskPath = '\Microsoft\Windows\Plug and Play\'
Disable = $true
}
}
configuration RepairEC2InstanceRemove
{
Script "RemoveRegistry-xenvbd"
{
SetScript = { Remove-Item -Path 'registry::HKLM\SYSTEM\CurrentControlSet\Services\xenvbd\StartOverride' }
TestScript = { -not(Test-Path -Path 'registry::HKLM\SYSTEM\CurrentControlSet\Services\xenvbd\StartOverride') }
GetScript = {return @{
TestScript = $TestScript
SetScript = $SetScript
GetScript = $GetScript
Result = $Result
}
}
}
Script "RemoveRegistry-xenfilt"
{
SetScript = { Remove-Item -Path 'registry::HKLM\SYSTEM\CurrentControlSet\Services\xenfilt\StartOverride' }
TestScript = { -not(Test-Path -Path 'registry::HKLM\SYSTEM\CurrentControlSet\Services\xenfilt\StartOverride') }
GetScript = {return @{
TestScript = $TestScript
SetScript = $SetScript
GetScript = $GetScript
Result = $Result
}
}
}
Script "RemoveRegistry-xenbus"
{
SetScript = { Remove-Item -Path 'registry::HKLM\SYSTEM\CurrentControlSet\Services\xenbus\StartOverride' }
TestScript = { -not(Test-Path -Path 'registry::HKLM\SYSTEM\CurrentControlSet\Services\xenbus\StartOverride') }
GetScript = {return @{
TestScript = $TestScript
SetScript = $SetScript
GetScript = $GetScript
Result = $Result
}
}
}
Script "RemoveRegistry-xeniface"
{
SetScript = { Remove-Item -Path 'registry::HKLM\SYSTEM\CurrentControlSet\Services\xeniface\StartOverride' }
TestScript = { -not(Test-Path -Path 'registry::HKLM\SYSTEM\CurrentControlSet\Services\xeniface\StartOverride') }
GetScript = {return @{
TestScript = $TestScript
SetScript = $SetScript
GetScript = $GetScript
Result = $Result
}
}
}
Script "RemoveRegistry-xenvif"
{
SetScript = { Remove-Item -Path 'registry::HKLM\SYSTEM\CurrentControlSet\Services\xenvif\StartOverride' }
TestScript = { -not(Test-Path -Path 'registry::HKLM\SYSTEM\CurrentControlSet\Services\xenvif\StartOverride') }
GetScript = {return @{
TestScript = $TestScript
SetScript = $SetScript
GetScript = $GetScript
Result = $Result
}
}
}
}
configuration RepairEC2InstanceSet
{
Registry xenbus
{
Ensure = "Present"
Key = 'HKEY_lOCAL_MACHINE\System\CurrentControlSet\Services\Xenbus'
ValueName = "Count"
ValueData = "1"
ValueType = "Dword"
}
Registry xenbusParameter
{
Ensure = "Present"
Key = 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\XENBUS\Parameters'
ValueName = "ActiveDevice"
ValueData = 'PCI\VEN_5853&DEV_0001&SUBSYS_00015853&REV_01'
ValueType = "String"
}
Registry UpperFilters4d36e97d
{
Ensure = "Present"
Key = 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Class\{4d36e97d-e325-11ce-bfc1-08002be10318}'
ValueName = "UpperFilters"
ValueData = "XENFILT"
ValueType = "String"
}
Registry UpperFilters4d36e96a
{
Ensure = "Present"
Key = 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Class\{4d36e96a-e325-11ce-bfc1-08002be10318}'
ValueName = "UpperFilters"
ValueData = "XENFILT"
ValueType = "String"
}
}
Configuration FixRemediateDriverIssue
{
Node $node
{
DisableCleanupTask DisableCleanupTask{}
RepairEC2InstanceRemove RepairEC2InstanceRemove {}
RepairEC2InstanceSet RepairEC2InstanceSet {}
}
}
FixRemediateDriverIssue -OutputPath .
Start-DscConfiguration -Path FixRemediateDriverIssue -Wait -Force -Verbose