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
Write-Progress-Activity "Testing '$nameValue' for WannaCry vulnerabilities using WMI"-CurrentOperation "Retrieve operating system information"-PercentComplete 20
150
-
$osInformation=Get-WmiObject-ComputerName $nameValue-Class Win32_OperatingSystem -Property Caption, Version -Credential $Credential-ErrorAction Stop
Write-Progress-Activity "Testing '$nameValue' for WannaCry vulnerabilities using WMI"-Completed
196
199
197
200
$output= [PSCustomObject]@{
198
201
PSComputerName=$nameValue
199
202
OperatingSystemCaption=$osInformation.Caption
200
203
OperatingSystemVersion=$osInformation.Version
204
+
LastBootUpTime=$osInformation.ConvertToDateTime(
205
+
$osInformation.LastBootUpTime
206
+
)
201
207
Vulnerable=$vulnerable
202
208
AppliedHotFixID=$appliedHotFixId-join"|"
203
209
SMB1FeatureEnabled=$smb1FeatureEnabled
@@ -211,15 +217,15 @@ process {
211
217
"ByCimSession" {
212
218
foreach ($cimSessionValuein$CimSession) {
213
219
Write-Progress-Activity "Testing '$nameValue' for WannaCry vulnerabilities using CIM"-CurrentOperation "Retrieve operating system caption"-PercentComplete 20
214
-
$osInformation=Get-CimInstance-CimSession $cimSessionValue-ClassName Win32_OperatingSystem -Property Caption, Version
0 commit comments