You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Functions/Test-WannaCryVulnerability.ps1
+11-12Lines changed: 11 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
<#PSScriptInfo
2
2
3
3
.Version
4
-
2.0
4
+
2.1
5
5
.Guid
6
6
477aa3f4-0434-4925-9c92-7323066cceb7
7
7
.Author
@@ -11,8 +11,7 @@
11
11
.ProjectUri
12
12
https://github.com/dotps1/PSFunctions
13
13
.ReleaseNotes
14
-
Per Lee Holmes (@lee_holmes) there is still a needed patch for Windows 10 1607 and prior https://twitter.com/Lee_Holmes/status/864604299405410304. Added Operating System Version to returned object.
15
-
14
+
Replaced Write-Warning with Write-Error so it can be caught in a try catch block.
16
15
#>
17
16
18
17
<#
@@ -42,7 +41,7 @@
42
41
OperatingSystemCaption : Microsoft Windows 7 Professional
43
42
OperatingSystemVersion : 6.1.7601
44
43
Vulnerable : False
45
-
AppliedHotFixIds : KB4012212|KB4015546|KB4015549
44
+
AppliedHotFixID : KB4012212|KB4015546|KB4015549
46
45
SMB1FeatureEnabled : False
47
46
SMB1ProtocolEnabled : False
48
47
.Example
@@ -52,7 +51,7 @@
52
51
OperatingSystemCaption : Microsoft Windows 7 Professional
53
52
OperatingSystemVersion : 6.1.7601
54
53
Vulnerable : True
55
-
AppliedHotFixIds :
54
+
AppliedHotFixID :
56
55
SMB1FeatureEnabled : False
57
56
SMB1ProtocolEnabled : True
58
57
.Notes
@@ -154,13 +153,13 @@ process {
154
153
}
155
154
156
155
if ([Version]$osInformation.Version-ge [Version]"10.0.15063") {
157
-
Write-Warning-Message "$($osInformation.Caption)$($osInformation.Version) is not vulnerable to the WannaCry Exploit."
156
+
Write-Error-Message "$($osInformation.Caption)$($osInformation.Version) is not vulnerable to the WannaCry Exploit."
158
157
continue
159
158
}
160
159
161
160
# HotFixes
162
161
Write-Progress-Activity "Testing '$nameValue' for WannaCry vulnerabilities using WMI"-CurrentOperation "Inventory hotfix information"-PercentComplete 40
0 commit comments