@@ -250,6 +250,7 @@ catch
250
250
" " | out-file $fullFileName - Encoding ascii - Append
251
251
252
252
# Hardware
253
+ # Motherboard
253
254
# Turn off default Error Handler for WMI
254
255
$old_ErrorActionPreference = $ErrorActionPreference
255
256
$ErrorActionPreference = ' SilentlyContinue'
@@ -271,6 +272,7 @@ catch
271
272
272
273
" " | out-file $fullFileName - Encoding ascii - Append
273
274
275
+ # Proc, CPUs, Cores
274
276
# Turn off default Error Handler for WMI
275
277
$old_ErrorActionPreference = $ErrorActionPreference
276
278
$ErrorActionPreference = ' SilentlyContinue'
@@ -294,6 +296,30 @@ catch
294
296
295
297
" " | out-file $fullFileName - Encoding ascii - Append
296
298
299
+ # PowerPlan
300
+ # Turn off default Error Handler for WMI
301
+ $old_ErrorActionPreference = $ErrorActionPreference
302
+ $ErrorActionPreference = ' SilentlyContinue'
303
+
304
+ $mystring41 = Get-WmiObject - namespace " root\cimv2\power" –class Win32_PowerPlan - ComputerName $server | where {$_.IsActive } | select ElementName
305
+
306
+ # Reset default PS error handler
307
+ $ErrorActionPreference = $old_ErrorActionPreference
308
+
309
+ try
310
+ {
311
+ Write-output (" PowerPlan: {0} " -f $mystring41.ElementName )| out-file $fullFileName - Encoding ascii - Append
312
+ }
313
+ catch
314
+ {
315
+ Write-output " Error getting PowerPlan via WMI - WMI/Firewall issue? " | out-file $fullFileName - Encoding ascii - Append
316
+ Write-output " Error getting PowerPlan via WMI - WMI/Firewall issue? "
317
+ }
318
+
319
+ " " | out-file $fullFileName - Encoding ascii - Append
320
+
321
+
322
+
297
323
$mystring5 = " `r`n SQL Build reference: http://sqlserverbuilds.blogspot.com/ "
298
324
$mystring5 | out-file $fullFileName - Encoding ascii - Append
299
325
0 commit comments