-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathGet-ComputerInfo.ps1
1927 lines (1617 loc) · 111 KB
/
Get-ComputerInfo.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<#
Get-ComputerInfo.ps1
#>
[CmdletBinding()]
Param (
[Parameter(ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
HelpMessage="`r`nComputer: Which computers would you like to target? `r`n`r`nPlease enter computer names or IP addresses, one in each line. `r`n`r`nNotes:`r`n`t- To stop entering new values, please press [Enter] at an empty input row (and the script will run). `r`n`t- To exit this script, please press [Ctrl] + C`r`n")]
[Alias("ComputerName")]
[string[]]$Computer = "$env:COMPUTERNAME",
[Parameter(HelpMessage="`r`nOutput: In which folder or directory would you like to find the outputted files? `r`n`r`nPlease enter a valid file system path to a directory (a full path name of a directory i.e. folder path such as C:\Windows). `r`n`r`nNotes:`r`n`t- If the path name includes space characters, please enclose the path name in quotation marks (single or double). `r`n`t- The output of GatherNetworkInfo.vbs script may be found inside the '%windir%\system32\Config' directory. `r`n")]
[Alias("ReportPath")]
[string]$Output = "$env:temp",
[Parameter(HelpMessage="`r`nFile: Where is the txt file located, which contains the remote computer names? `r`n`r`nPlease enter a valid system filename ('FullPath'), which preferably includes the path to the file as well (a full path name of a file such as C:\Windows\file.txt). `r`n`r`nNotes:`r`n`t- If no path is defined, the current directory gets searched for the text file. `r`n`t- If the full filename or the directory name includes space characters, `r`n`t please enclose the whole inputted string in quotation marks (single or double). `r`n`t- The values inside the text file could be computer names or IP addresses, one in each line. `r`n`t- If remote computers are specified, this script will use Windows Management Instrumentation (WMI) over Remote Procedure Calls (RPCs). `r`n")]
[Alias("ListOfComputersInATxtFile","List")]
[string]$File,
[switch]$SystemInfo,
[Alias("ExtractMsInfo32ToAFile","ExtractMsInfo32","MsInfo32ContentsToFile","MsInfo32Report","Expand","Export")]
[switch]$Extract,
[Alias("OpenMsInfo32PopUpWindow","Window")]
[switch]$MsInfo32,
[Alias("Vbs")]
[switch]$GatherNetworkInfo,
[Alias("GetComputerInfoCmdlet","GetComputerInfo")]
[switch]$Cmdlet
)
Begin {
# Establish some common variables
$ErrorActionPreference = "Stop"
$timestamp = Get-Date -Format yyyyMMdd
$date = Get-Date -Format g
$time = Get-Date -Format HH.mm
$empty_line = ""
$computers = @()
$osinfo = @()
$volumes = @()
$partition_table = @()
$available_computers = @()
$unavailable_computers = @()
$host_name = $env:COMPUTERNAME
$num_switches = 0
# Change the following variables for the style of the report. # Credit: clayman2: "Disk Space"
# Note: Using a hex format when defining the colors will probably give the best results in most browsers
$background_color = "#FFFFFF"
$title_font_family = "Gill Sans"
$title_font_size = "19px"
$title_bg_color = "#FFFFFF"
$heading_font_family = "Arial"
$heading_font_size = "12px"
$heading_name_bg_color = "#FFFFFF"
$data_font_family = "Calibri"
$data_font_size = "11px"
$data_alternating_row_color_odd = "#cccccc"
$data_alternating_row_color_even = "#FFFFFF"
# Colors for free space # Credit: clayman2: "Disk Space"
$very_low_space = "#b81321" # very low space: less than 1 GB or less than 5 % free
$low_space = "#ffca00" # low space: less than 5 GB or less than 10 % free
$medium_space = "#137abb" # medium space: less than 10 GB or less than 15 % free
# Function used to convert bytes to MB or GB or TB # Credit: clayman2: "Disk Space"
function ConvertBytes {
param($size)
If ($size -lt 1MB) {
$drive_size = $size / 1KB
$drive_size = [Math]::Round($drive_size, 2)
[string]$drive_size + ' KB'
} ElseIf ($size -lt 1GB) {
$drive_size = $size / 1MB
$drive_size = [Math]::Round($drive_size, 2)
[string]$drive_size + ' MB'
} ElseIf ($size -lt 1TB) {
$drive_size = $size / 1GB
$drive_size = [Math]::Round($drive_size, 2)
[string]$drive_size + ' GB'
} Else {
$drive_size = $size / 1TB
$drive_size = [Math]::Round($drive_size, 2)
[string]$drive_size + ' TB'
} # else
} # function
# Function used to convert the Time Zone Offset from minutes to hours
function DayLight {
param($minutes)
If ($minutes -gt 0) {
$hours = ($minutes / 60)
[string]'+' + $hours + ' h'
} ElseIf ($minutes -lt 0) {
$hours = ($minutes / 60)
[string]$hours + ' h'
} ElseIf ($minutes -eq 0) {
[string]'0 h (GMT)'
} Else {
[string]''
} # else
} # function
# Function used to calculate the UpTime of a computer
function UpTime {
param ()
$wmi_os = Get-WmiObject -class Win32_OperatingSystem -ComputerName $env:COMPUTERNAME
$up_time = ($wmi_os.ConvertToDateTime($wmi_os.LocalDateTime)) - ($wmi_os.ConvertToDateTime($wmi_os.LastBootUpTime))
If ($up_time.Days -ge 2) {
$uptime_result = [string]$up_time.Days + ' days ' + $up_time.Hours + ' h ' + $up_time.Minutes + ' min'
} ElseIf ($up_time.Days -gt 0) {
$uptime_result = [string]$up_time.Days + ' day ' + $up_time.Hours + ' h ' + $up_time.Minutes + ' min'
} ElseIf ($up_time.Hours -gt 0) {
$uptime_result = [string]$up_time.Hours + ' h ' + $up_time.Minutes + ' min'
} ElseIf ($up_time.Minutes -gt 0) {
$uptime_result = [string]$up_time.Minutes + ' min ' + $up_time.Seconds + ' sec'
} ElseIf ($up_time.Seconds -gt 0) {
$uptime_result = [string]$up_time.Seconds + ' sec'
} Else {
$uptime_result = [string]''
} # else (if)
If ($uptime_result.Contains(" 0 h")) {
$uptime_result = $uptime_result.Replace(" 0 h"," ")
} If ($uptime_result.Contains(" 0 min")) {
$uptime_result = $uptime_result.Replace(" 0 min"," ")
} If ($uptime_result.Contains(" 0 sec")) {
$uptime_result = $uptime_result.Replace(" 0 sec"," ")
} # if ($uptime_result: first)
$uptime_result
} # function
# Test if the Output-path ("ReportPath") exists
If ((Test-Path $Output) -eq $false) {
$invalid_output_path_was_found = $true
# Display an error message in console
$empty_line | Out-String
Write-Warning "'$Output' doesn't seem to be a valid path name."
$empty_line | Out-String
Write-Verbose "Please consider checking that the Output ('ReportPath') location '$Output', where the resulting output files are ought to be written, was typed correctly and that it is a valid file system path, which points to a directory. If the path name includes space characters, please enclose the path name in quotation marks (single or double)." -verbose
$empty_line | Out-String
$skip_text = "Couldn't find -Output folder '$Output'."
Write-Output $skip_text
$empty_line | Out-String
Exit
Return
} Else {
# Resolve the Output-path ("ReportPath") (if the Output-path is specified as relative)
$real_output_path = Resolve-Path -Path $Output
$csv_path = "$real_output_path\computer_info.csv"
$html_path = "$real_output_path\computer_info.html"
# Create a HTML-file
# $html_file = New-Item -ItemType File -Path "$real_output_path\computer_info_$timestamp.html" -Force # an alternative filename format
$html_file = New-Item -ItemType File -Path $html_path -Force
$html_file | Out-Null
} # Else (If Test-Path $Output)
# If an input file is specified, add the contents of the file to the list of computers to process
If ($File) {
If (((Test-Path $File) -eq $false) -or ((Test-Path $File -PathType Leaf) -eq $false)) {
$invalid_txt_file_was_found = $true
# Display an error message in console
$empty_line | Out-String
Write-Warning "'$File' doesn't seem to be a valid FullPath or -File parameter value."
$empty_line | Out-String
Write-Verbose "Please consider checking that the full filename with the path name (the '-File' variable value) '$File' was typed correctly and that it includes the path to the file as well. If the full filename or the directory name includes space characters, please enclose the whole string in quotation marks (single or double)." -verbose
$empty_line | Out-String
$skip_text = "Didn't open '$File'."
Write-Output $skip_text
Exit
Return
} Else {
# Resolve path (if path is specified as relative)
# \S Any nonwhitespace character (excludes space, tab and carriage return).
# \d Any decimal digit.
# Source: http://powershellcookbook.com/recipe/qAxK/appendix-b-regular-expression-reference
$real_input_path = (Resolve-Path $File).Path
$computer_list = (Get-Content $real_input_path) | Where { $_ -match '\S' }
ForEach ($item in $computer_list) {
$computers += $item
} # ForEach $item
} # Else (If Test-Path $File)
} Else {
$continue = $true
} # Else (If $File)
# If a value for -Computer parameter is specified, add the values to the list of computers to process
If ($Computer) {
ForEach ($individual_computer in $Computer) {
$computers += $individual_computer
} # ForEach $item
} Else {
# Take the objects that are piped into the script
$computers += @($input)
} # Else (If $FilePath)
# Count the amount of switches used
If ($SystemInfo) { $num_switches++ }
If ($MsInfo32) { $num_switches++ }
If ($Extract) { $num_switches++; $num_switches++ }
If ($GatherNetworkInfo) { $num_switches++ }
If ($Cmdlet) { $num_switches++ }
} # Begin
Process {
# Try to process one available instance only once
# Credit: Jeff Hicks: "Validating Computer Lists with PowerShell" https://www.petri.com/validating-computer-lists-with-powershell
# $unique_computers = $computers.ToUpper() | select -Unique
$unique_computers = $computers | select -Unique
ForEach ($computer_candidate in $unique_computers) {
If ($computer_candidate -match '\d' -eq $true){
# Exclude computer candidate names that contain only numbers and return to the top of the program loop (ForEach $computer_candidate)
# \d Any decimal digit.
# \s Any whitespace character.
# $env:USERNAME
# Source: http://powershellcookbook.com/recipe/qAxK/appendix-b-regular-expression-reference
$empty_line | Out-String
Write-Warning "Computer '$computer_candidate': Computer name cannot contain only numbers."
$empty_line | Out-String
Write-Verbose "Please consider checking that the computer name '$computer_candidate' was typed correctly. Computer name cannot contain only numbers, may not be identical with the user name and cannot contain spaces." -verbose
$empty_line | Out-String
$skip_text = "Didn't detect '$computer_candidate'."
Write-Output $skip_text
Continue
} Else {
$connection = Test-Connection -ComputerName $computer_candidate -Count 1 -Quiet
sleep -m 200
If ($connection -eq $true) {
$available_computers += $computer_candidate
} Else {
# Notify the user about the unavailable computers
$empty_line | Out-String
Write-Verbose "The computer '$computer_candidate' could not be found." -verbose
$unavailable_computers += $computer_candidate
} # Else (If Test-Connection)
} # Else
} # ForEach
If ($available_computers.Count -eq 0) {
$empty_line | Out-String
$exit_text = "Couldn't find $($Computer -join ', ')."
Write-Output $exit_text
$empty_line | Out-String
Exit
} Else {
# Display a welcoming screen in console
$empty_line | Out-String
$header = "Computer Info"
$coline = "-------------"
Write-Output $header
$coline | Out-String
} # Else (If $FilePath)
# Set the progress bar variables ($id denominates different progress bars, if more than one is being displayed)
$activity = "Retrieving Remote Computer Info"
$status = " "
$task = "Setting Initial Variables"
$num_computers = $available_computers.Count
$threshold = ($num_computers + $num_switches)
$activities = (($num_computers * 2) + $num_switches)
$total_steps = (($num_computers * 2) + $num_switches + 1 )
$task_number = 0
$name_count = 0
$switch_count = 0
$id = 1
# Start the progress bar if there is more than one unique computer to process or any swithes were activated
If ($threshold -ge 2) {
Write-Progress -Id $id -Activity $activity -Status $status -CurrentOperation $task -PercentComplete ((0.000002 / $total_steps) * 100)
} # If ($threshold)
ForEach ($name in $available_computers) {
# Increment the counters
$task_number++
$name_count++
# Update the progress bar if there is more than one unique computer to process or any swithes were activated
If ($threshold -ge 2) {
$activity = "Retrieving Remote Computer Info $task_number/$activities"
Write-Progress -Id $id -Activity $activity -Status $status -CurrentOperation $name -PercentComplete (($task_number / $total_steps) * 100)
} # If ($threshold)
# Read the registry
$reg_key = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
If ( -not ( Test-Path $reg_key )) {
$continue = $true
} Else {
$registry = Get-ItemProperty -Path $reg_key
} # Else
# Retrieve basic os and computer related information with WMI and display it in console
$bios = Get-WmiObject -class Win32_BIOS -ComputerName $name
$compsys = Get-WmiObject -class Win32_ComputerSystem -ComputerName $name
$compsysprod = Get-WMIObject -class Win32_ComputerSystemProduct -ComputerName $name
$enclosure = Get-WmiObject -Class Win32_SystemEnclosure -ComputerName $name
$mobilebroadband = Get-WmiObject -Class Win32_POTSModem -ComputerName $name
$motherboard = Get-WmiObject -class Win32_BaseBoard -ComputerName $name
$network = Get-WmiObject -Class Win32_NetworkAdapter -ComputerName $name
$os = Get-WmiObject -class Win32_OperatingSystem -ComputerName $name
$processor = Get-WMIObject -class Win32_Processor -ComputerName $name
$system = Get-WmiObject -Class MS_SystemInformation -Namespace 'root\WMI' -ComputerName $name
$timezone = Get-WmiObject -class Win32_TimeZone -ComputerName $name
$video = Get-WmiObject -class Win32_VideoController -ComputerName $name
$ethernet = $network | Where-Object { $_.AdapterTypeId -ne 9 -and $_.MACAddress -ne $null -and $_.ProductName -notlike "*Virtual*" }
$powershell = $PSVersionTable.PSVersion
# Source: https://msdn.microsoft.com/en-us/library/aa394102(v=vs.85).aspx
Switch ($compsys.DomainRole) {
{ $_ -lt 0 } { $domain_role = "" }
{ $_ -eq 0 } { $domain_role = "Standalone Workstation" }
{ $_ -eq 1 } { $domain_role = "Member Workstation" }
{ $_ -eq 2 } { $domain_role = "Standalone Server" }
{ $_ -eq 3 } { $domain_role = "Member Server" }
{ $_ -eq 4 } { $domain_role = "Backup Domain Controller" }
{ $_ -eq 5 } { $domain_role = "Primary Domain Controller" }
{ $_ -gt 5 } { $domain_role = "" }
} # switch domainrole
# Source: https://msdn.microsoft.com/en-us/library/aa394239(v=vs.85).aspx
Switch ($os.ProductType) {
{ $_ -lt 1 } { $product_type = "" }
{ $_ -eq 1 } { $product_type = "Work Station" }
{ $_ -eq 2 } { $product_type = "Domain Controller" }
{ $_ -eq 3 } { $product_type = "Server" }
{ $_ -gt 3 } { $product_type = "" }
} # switch producttype
# Source: https://msdn.microsoft.com/en-us/library/aa394474(v=vs.85).aspx
Switch ($enclosure.ChassisTypes) {
{ $_ -lt 1 } { $chassis = "" }
{ $_ -eq 1 } { $chassis = "Other" }
{ $_ -eq 2 } { $chassis = "Unknown" }
{ $_ -eq 3 } { $chassis = "Desktop " }
{ $_ -eq 4 } { $chassis = "Low Profile Desktop" }
{ $_ -eq 5 } { $chassis = "Pizza Box" }
{ $_ -eq 6 } { $chassis = "Mini Tower" }
{ $_ -eq 7 } { $chassis = "Tower" }
{ $_ -eq 8 } { $chassis = "Portable" }
{ $_ -eq 9 } { $chassis = "Laptop" }
{ $_ -eq 10 } { $chassis = "Notebook" }
{ $_ -eq 11 } { $chassis = "Hand Held" }
{ $_ -eq 12 } { $chassis = "Docking Station" }
{ $_ -eq 13 } { $chassis = "All in One" }
{ $_ -eq 14 } { $chassis = "Sub Notebook" }
{ $_ -eq 15 } { $chassis = "Space-Saving" }
{ $_ -eq 16 } { $chassis = "Lunch Box" }
{ $_ -eq 17 } { $chassis = "Main System Chassis" }
{ $_ -eq 18 } { $chassis = "Expansion Chassis" }
{ $_ -eq 19 } { $chassis = "SubChassis" }
{ $_ -eq 20 } { $chassis = "Bus Expansion Chassis" }
{ $_ -eq 21 } { $chassis = "Peripheral Chassis" }
{ $_ -eq 22 } { $chassis = "Storage Chassis" }
{ $_ -eq 23 } { $chassis = "Rack Mount Chassis" }
{ $_ -eq 24 } { $chassis = "Sealed-Case PC" }
{ $_ -gt 24 } { $chassis = "" }
} # switch chassistypes
$is_a_laptop = $false
If (($chassis -eq "Laptop") -or ($chassis -eq "Notebook") -or ($chassis -eq "Sub Notebook")) {
$is_a_laptop = $true
} Else {
$continue = $true
} # Else
# Source: https://msdn.microsoft.com/en-us/library/aa394102(v=vs.85).aspx
Switch ($compsys.PCSystemType) {
{ $_ -lt 0 } { $pc_type = "" }
{ $_ -eq 0 } { $pc_type = "Unspecified" }
{ $_ -eq 1 } { $pc_type = "Desktop" }
{ $_ -eq 2 } { $pc_type = "Mobile" }
{ $_ -eq 3 } { $pc_type = "Workstation" }
{ $_ -eq 4 } { $pc_type = "Enterprise Server" }
{ $_ -eq 5 } { $pc_type = "Small Office and Home Office (SOHO) Server" }
{ $_ -eq 6 } { $pc_type = "Appliance PC" }
{ $_ -eq 7 } { $pc_type = "Performance Server" }
{ $_ -eq 8 } { $pc_type = "Maximum" }
{ $_ -gt 8 } { $pc_type = "" }
} # switch pcsystemtype
# Source: https://msdn.microsoft.com/en-us/library/aa394512(v=vs.85).aspx
Switch ($video.CurrentScanMode) {
{ $_ -lt 1 } { $scan_mode = "" }
{ $_ -eq 1 } { $scan_mode = "Other" }
{ $_ -eq 2 } { $scan_mode = "Unknown" }
{ $_ -eq 3 } { $scan_mode = "Interlaced" }
{ $_ -eq 4 } { $scan_mode = "Noninterlaced" }
{ $_ -gt 4 } { $scan_mode = "" }
} # switch CurrentScanMode
# Source: https://www.autoitscript.com/autoit3/docs/appendix/OSLangCodes.htm
$os_Language = @{ 4 = "Chinese - Simplified"; 1025 = "Arabic - Saudi Arabia"; 1026 = "Bulgarian - Bulgaria"; 1027 = "Catalan - Spain"; 1028 = "Chinese (Traditional) - Taiwan"; 1029 = "Czech - Czech Republic"; 1030 = "Danish - Denmark"; 1031 = "German - Germany"; 1032 = "Greek - Greece"; 1033 = "English - United States"; 1034 = "Spanish - Spain"; 1035 = "Finnish - Finland"; 1036 = "French - France"; 1037 = "Hebrew - Israel"; 1038 = "Hungarian - Hungary"; 1039 = "Icelandic - Iceland"; 1040 = "Italian - Italy"; 1041 = "Japanese - Japan"; 1042 = "Korean - Korea"; 1043 = "Dutch - Netherlands"; 1044 = "Norwegian (Bokmål) - Norway"; 1045 = "Polish - Poland"; 1046 = "Portuguese - Brazil"; 1047 = "Romansh - Switzerland"; 1048 = "Romanian - Romania"; 1049 = "Russian - Russia"; 1050 = "Croatian - Croatia"; 1051 = "Slovak - Slovakia"; 1052 = "Albanian - Albania"; 1053 = "Swedish - Sweden"; 1054 = "Thai - Thailand"; 1055 = "Turkish - Turkey"; 1056 = "Urdu - Pakistan"; 1057 = "Indonesian - Indonesia"; 1058 = "Ukrainian - Ukraine"; 1059 = "Belarusian - Belarus"; 1060 = "Slovenian - Slovenia"; 1061 = "Estonian - Estonia"; 1062 = "Latvian - Latvia"; 1063 = "Lithuanian - Lithuanian"; 1064 = "Tajik (Cyrillic) - Tajikistan"; 1065 = "Persian - Iran"; 1066 = "Vietnamese - Vietnam"; 1067 = "Armenian - Armenia"; 1068 = "Azeri (Latin) - Azerbaijan"; 1069 = "Basque - Basque"; 1070 = "Upper Sorbian - Germany"; 1071 = "Macedonian - Macedonia"; 1074 = "Setswana / Tswana - South Africa"; 1076 = "isiXhosa - South Africa"; 1077 = "isiZulu - South Africa"; 1078 = "Afrikaans - South Africa"; 1079 = "Georgian - Georgia"; 1080 = "Faroese - Faroe Islands"; 1081 = "Hindi - India"; 1082 = "Maltese - Malta"; 1083 = "Sami (Northern) - Norway"; 1086 = "Malay - Malaysia"; 1087 = "Kazakh - Kazakhstan"; 1088 = "Kyrgyz - Kyrgyzstan"; 1089 = "Swahili - Kenya"; 1090 = "Turkmen - Turkmenistan"; 1091 = "Uzbek (Latin) - Uzbekistan"; 1092 = "Tatar - Russia"; 1093 = "Bangla - Bangladesh"; 1094 = "Punjabi - India"; 1095 = "Gujarati - India"; 1096 = "Oriya - India"; 1097 = "Tamil - India"; 1098 = "Telugu - India"; 1099 = "Kannada - India"; 1100 = "Malayalam - India"; 1101 = "Assamese - India"; 1102 = "Marathi - India"; 1103 = "Sanskrit - India"; 1104 = "Mongolian (Cyrillic) - Mongolia"; 1105 = "Tibetan - China"; 1106 = "Welsh - United Kingdom"; 1107 = "Khmer - Cambodia"; 1108 = "Lao - Lao PDR"; 1110 = "Galician - Spain"; 1111 = "Konkani - India"; 1113 = "(reserved) - (reserved)"; 1114 = "Syriac - Syria"; 1115 = "Sinhala - Sri Lanka"; 1116 = "Cherokee - Cherokee"; 1117 = "Inuktitut (Canadian_Syllabics) - Canada"; 1118 = "Amharic - Ethiopia"; 1121 = "Nepali - Nepal"; 1122 = "Frisian - Netherlands"; 1123 = "Pashto - Afghanistan"; 1124 = "Filipino - Philippines"; 1125 = "Divehi - Maldives"; 1128 = "Hausa - Nigeria"; 1130 = "Yoruba - Nigeria"; 1131 = "Quechua - Bolivia"; 1132 = "Sesotho sa Leboa - South Africa"; 1133 = "Bashkir - Russia"; 1134 = "Luxembourgish - Luxembourg"; 1135 = "Greenlandic - Greenland"; 1136 = "Igbo - Nigeria"; 1139 = "Tigrinya - Ethiopia"; 1141 = "Hawiian - United States"; 1144 = "Yi - China"; 1146 = "Mapudungun - Chile"; 1148 = "Mohawk - Canada"; 1150 = "Breton - France"; 1152 = "Uyghur - China"; 1153 = "Maori - New Zealand"; 1154 = "Occitan - France"; 1155 = "Corsican - France"; 1156 = "Alsatian - France"; 1157 = "Sakha - Russia"; 1158 = "K'iche - Guatemala"; 1159 = "Kinyarwanda - Rwanda"; 1160 = "Wolof - Senegal"; 1164 = "Dari - Afghanistan"; 1169 = "Scottish Gaelic - United Kingdom"; 1170 = "Central Kurdish - Iraq"; 2049 = "Arabic - Iraq"; 2051 = "Valencian - Valencia"; 2052 = "Chinese (Simplified) - China"; 2055 = "German - Switzerland"; 2057 = "English - United Kingdom"; 2058 = "Spanish - Mexico"; 2060 = "French - Belgium"; 2064 = "Italian - Switzerland"; 2067 = "Dutch - Belgium"; 2068 = "Norwegian (Nynorsk) - Norway"; 2070 = "Portuguese - Portugal"; 2074 = "Serbian (Latin) - Serbia and Montenegro"; 2077 = "Swedish - Finland"; 2080 = "Urdu - (reserved)"; 2092 = "Azeri (Cyrillic) - Azerbaijan"; 2094 = "Lower Sorbian - Germany"; 2098 = "Setswana / Tswana - Botswana"; 2107 = "Sami (Northern) - Sweden"; 2108 = "Irish - Ireland"; 2110 = "Malay - Brunei Darassalam"; 2115 = "Uzbek (Cyrillic) - Uzbekistan"; 2117 = "Bangla - Bangladesh"; 2118 = "Punjabi - Pakistan"; 2121 = "Tamil - Sri Lanka"; 2128 = "Mongolian (Mong) - Mongolia"; 2137 = "Sindhi - Pakistan"; 2141 = "Inuktitut (Latin) - Canada"; 2143 = "Tamazight (Latin) - Algeria"; 2151 = "Pular - Senegal"; 2155 = "Quechua - Ecuador"; 2163 = "Tigrinya - Eritrea"; 3073 = "Arabic - Egypt"; 3076 = "Chinese - Hong Kong SAR"; 3079 = "German - Austria"; 3081 = "English - Australia"; 3082 = "Spanish - Spain"; 3084 = "French - Canada"; 3098 = "Serbian (Cyrillic) - Serbia and Montenegro"; 3131 = "Sami (Northern) - Finland"; 3179 = "Quechua - Peru"; 4097 = "Arabic - Libya"; 4100 = "Chinese - Singapore"; 4103 = "German - Luxembourg"; 4105 = "English - Canada"; 4106 = "Spanish - Guatemala"; 4108 = "French - Switzerland"; 4122 = "Croatian (Latin) - Bosnia and Herzegovina"; 4155 = "Sami (Lule) - Norway"; 4191 = "Central Atlas Tamazight (Tifinagh) - Morocco"; 5121 = "Arabic - Algeria"; 5124 = "Chinese - Macao SAR"; 5127 = "German - Liechtenstein"; 5129 = "English - New Zealand"; 5130 = "Spanish - Costa Rica"; 5132 = "French - Luxembourg"; 5146 = "Bosnian (Latin) - Bosnia and Herzegovina"; 5179 = "Sami (Lule) - Sweden"; 6145 = "Arabic - Morocco"; 6153 = "English - Ireland"; 6154 = "Spanish - Panama"; 6156 = "French - Monaco"; 6170 = "Serbian (Latin) - Bosnia and Herzegovina"; 6203 = "Sami (Southern) - Norway"; 7169 = "Arabic - Tunisia"; 7177 = "English - South Africa"; 7178 = "Spanish - Dominican Republic"; 7194 = "Serbian (Cyrillic) - Bosnia and Herzegovina"; 7227 = "Sami (Southern) - Sweden"; 8193 = "Arabic - Oman"; 8201 = "English - Jamaica"; 8202 = "Spanish - Venezuela"; 8218 = "Bosnian (Cyrillic) - Bosnia and Herzegovina"; 8251 = "Sami (Skolt) - Finland"; 9217 = "Arabic - Yemen"; 9225 = "English - Caribbean"; 9226 = "Spanish - Colombia"; 9242 = "Serbian (Latin) - Serbia"; 9275 = "Sami (Inari) - Finland"; 10241 = "Arabic - Syria"; 10249 = "English - Belize"; 10250 = "Spanish - Peru"; 10266 = "Serbian (Cyrillic) - Serbia"; 11265 = "Arabic - Jordan"; 11273 = "English - Trinidad and Tobago"; 11274 = "Spanish - Argentina"; 11290 = "Serbian (Latin) - Montenegro"; 12289 = "Arabic - Lebanon"; 12297 = "English - Zimbabwe"; 12298 = "Spanish - Ecuador"; 12314 = "Serbian (Cyrillic) - Montenegro"; 13313 = "Arabic - Kuwait"; 13321 = "English - Philippines"; 13322 = "Spanish - Chile"; 14337 = "Arabic - U.A.E."; 14346 = "Spanish - Uruguay"; 15361 = "Arabic - Bahrain"; 15370 = "Spanish - Paraguay"; 16385 = "Arabic - Qatar"; 16393 = "English - India"; 16394 = "Spanish - Bolivia"; 17417 = "English - Malaysia"; 17418 = "Spanish - El Salvador"; 18441 = "English - Singapore"; 18442 = "Spanish - Honduras"; 19466 = "Spanish - Nicaragua"; 20490 = "Spanish - Puerto Rico"; 21514 = "Spanish - United States"; 31748 = "Chinese - Traditional" }
# CPU
$CPUArchitecture_data = $processor.Name
If ($CPUArchitecture_data.Contains("(TM)")) {
$CPUArchitecture_data = $CPUArchitecture_data.Replace("(TM)","")
} If ($CPUArchitecture_data.Contains("(R)")) {
$CPUArchitecture_data = $CPUArchitecture_data.Replace("(R)","")
} Else {
$continue = $true
} # else (CPUArchitecture_data)
# Manufacturer
$Manufacturer_data = $compsysprod.Vendor
If ($Manufacturer_data.Contains("HP")) {
$Manufacturer_data = $Manufacturer_data.Replace("HP","Hewlett-Packard")
} Else {
$continue = $true
} # else (Manufacturer_data)
# Operating System
$OperatingSystem_data = $os.Caption
If ($OperatingSystem_data.Contains(",")) {
$OperatingSystem_data = $OperatingSystem_data.Replace(",","")
} If ($OperatingSystem_data.Contains("(R)")) {
$OperatingSystem_data = $OperatingSystem_data.Replace("(R)","")
} Else {
$continue = $true
} # else (OperatingSystem_data)
$osinfo += $obj_info = New-Object -TypeName PSCustomObject -Property @{
'Computer' = $name
'Manufacturer' = $Manufacturer_data
'Computer Model' = $compsys.Model
'System Type' = $compsys.SystemType
'Domain Role' = $domain_role
'Product Type' = $product_type
'Chassis' = $chassis
'PC Type' = $pc_type
'Is a Laptop?' = $is_a_laptop
'Model Version' = $system.SystemSKU
'CPU' = $CPUArchitecture_data
'Video Card' = (@(ForEach ($videocard in $video) {
If ($videocard.AdapterDACType -ne $null) {
[string]$videocard.Name.Replace('(R)','') + ' (' + $videocard.AdapterDACType + ')'
} Else {
$videocard.Name.Replace('(R)','')
} # else
}) | Out-String).Trim()
'Video Card_br' = (@(ForEach ($videocard in $video) {
If ($videocard.AdapterDACType -ne $null) {
[string]$videocard.Name.Replace('(R)','') + ' (' + $videocard.AdapterDACType + ')'
} Else {
$videocard.Name.Replace('(R)','')
} # else
}) -join '<br />')
'Resolution' = (@(ForEach ($videocard in $video) { [string]$videocard.CurrentHorizontalResolution + ' x ' + $videocard.CurrentVerticalResolution + ' @ ' + $videocard.CurrentRefreshRate + ' MHz' + ' (' + $scan_mode + ')' }) | Out-String).Trim()
'Resolution_br' = (@(ForEach ($videocard in $video) { [string]$videocard.CurrentHorizontalResolution + ' x ' + $videocard.CurrentVerticalResolution + ' @ ' + $videocard.CurrentRefreshRate + ' MHz' + ' (' + $scan_mode + ')' }) -join '<br />')
'Operating System' = $OperatingSystem_data
'Architecture' = $os.OSArchitecture
'Windows Edition ID' = If ($registry.EditionID) {$registry.EditionID} Else {" "}
'Windows Installation Type' = If ($registry.InstallationType) {$registry.InstallationType} Else {" "}
'Windows Platform' = ([System.Environment]::OSVersion).Platform
'Type' = If ($registry.CurrentType) {$registry.CurrentType} Else {" "}
'SP Version' = $os.CSDVersion
'Windows BuildLab Extended' = If ($registry.BuildLabEx) {$registry.BuildLabEx} Else {" "}
'Windows BuildLab' = If ($registry.BuildLab) {$registry.BuildLab} Else {" "}
'Windows Build Branch' = If ($registry.BuildBranch) {$registry.BuildBranch} Else {" "}
'Windows Build Number' = $os.BuildNumber
'Windows Release Id' = If ($registry.ReleaseId) {$registry.ReleaseId} Else {" "}
'Current Version' = If ($registry.CurrentVersion) {$registry.CurrentVersion} Else {" "}
'Memory' = (ConvertBytes($compsys.TotalPhysicalMemory))
'Video Card Memory' = (@(ForEach ($videocard in $video) { (ConvertBytes($videocard.AdapterRAM)) }) | Out-String).Trim()
'Video Card Memory_br' = (@(ForEach ($videocard in $video) { (ConvertBytes($videocard.AdapterRAM)) }) -join '<br />')
'Logical Processors' = $processor.NumberOfLogicalProcessors
'Cores' = $processor.NumberOfCores
'Physical Processors' = $compsys.NumberOfProcessors
'Country Code' = $os.CountryCode
'OS Language' = $os_Language[[int]$os.OSLanguage]
'Video Card Driver Date' = (@(ForEach ($videocard in $video) { ($videocard.ConvertToDateTime($videocard.DriverDate)).ToShortDateString() }) | Out-String).Trim()
'Video Card Driver Date_br' = (@(ForEach ($videocard in $video) { ($videocard.ConvertToDateTime($videocard.DriverDate)).ToShortDateString() }) -join '<br />')
'BIOS Release Date' = (Get-Date -year ($system.BIOSReleaseDate.split("/")[-1]) -month ($system.BIOSReleaseDate.split("/")[0]) -day ($system.BIOSReleaseDate.split("/")[1])).ToShortDateString()
'OS Install Date' = ($os.ConvertToDateTime($os.InstallDate)).ToShortDateString()
'Last BootUp' = (($os.ConvertToDateTime($os.LastBootUpTime)).ToShortDateString() + ' ' + ($os.ConvertToDateTime($os.LastBootUpTime)).ToShortTimeString())
'UpTime' = (Uptime)
'Date' = $date
'Daylight Bias' = ((DayLight($timezone.DaylightBias)) + ' (' + $timezone.DaylightName + ')')
'Time Offset (Current)' = (DayLight($timezone.Bias))
'Time Offset (Normal)' = (DayLight($os.CurrentTimeZone))
'Time (Current)' = (Get-Date).ToShortTimeString()
'Time (Normal)' = If (((Get-Date).IsDaylightSavingTime()) -eq $true) {
(((Get-Date).AddMinutes($timezone.DaylightBias)).ToShortTimeString() + ' (' + $timezone.StandardName + ')')
} ElseIf (((Get-Date).IsDaylightSavingTime()) -eq $false) {
(Get-Date).ToShortTimeString() + ' (' + $timezone.StandardName + ')'
} Else {
$continue = $true
} # else
'Daylight In Effect' = $compsys.DaylightInEffect
# 'Daylight In Effect' = (Get-Date).IsDaylightSavingTime()
'Time Zone' = $timezone.Description
'Connectivity' = (@(ForEach ($adapter in $ethernet) {
If ($adapter.NetConnectionID -ne $null) {
[string]$adapter.ProductName.Replace('(R)','') + ' (' + $adapter.NetConnectionID + ')'
} Else {
[string]$adapter.ProductName.Replace('(R)','')
} # else
}) | Out-String).Trim()
'Connectivity_br' = (@(ForEach ($adapter in $ethernet) {
If ($adapter.NetConnectionID -ne $null) {
[string]$adapter.ProductName.Replace('(R)','') + ' (' + $adapter.NetConnectionID + ')'
} Else {
[string]$adapter.ProductName.Replace('(R)','')
} # else
}) -join '<br />')
'Mobile Broadband' = (@(ForEach ($modem in $mobilebroadband) { [string]$modem.Name + ' (' + $modem.AttachedTo + ')'}) | Out-String).Trim()
'Mobile Broadband_br' = (@(ForEach ($modem in $mobilebroadband) { [string]$modem.Name + ' (' + $modem.AttachedTo + ')'}) -join '<br />')
'OS Version' = $os.Version
'PowerShell Version' = [string]$powershell.Major + '.' + $powershell.Minor + '.' + $powershell.Build + '.' + $powershell.Revision
'BIOS Version' = $bios.SMBIOSBIOSVersion
'Mother Board Version' = $system.BaseBoardVersion
'Video Card Version' = (@(ForEach ($videocard in $video) { $videocard.DriverVersion }) | Out-String).Trim()
'Video Card Version_br' = (@(ForEach ($videocard in $video) { $videocard.DriverVersion }) -join '<br />')
'ID' = $compsysprod.IdentifyingNumber
'Serial Number (BIOS)' = $bios.SerialNumber
'Serial Number (Mother Board)' = $motherboard.SerialNumber
'Serial Number (OS)' = $os.SerialNumber
'UUID' = $compsysprod.UUID
} # New-Object
# Display OS Info in console
$obj_osinfo_selection = $osinfo | Select-Object 'Computer','Manufacturer','Computer Model','System Type','Domain Role','Product Type','Chassis','PC Type','Is a Laptop?','Model Version','CPU','Video Card','Resolution','Operating System','Architecture','Windows Edition ID','Windows Installation Type','Windows Platform','Type','SP Version','Windows BuildLab Extended','Windows BuildLab','Windows Build Branch','Windows Build Number','Windows Release Id','Current Version','Memory','Video Card Memory','Logical Processors','Cores','Physical Processors','Country Code','OS Language','Video Card Driver Date','BIOS Release Date','OS Install Date','Last BootUp','UpTime','Date','Daylight Bias','Time Offset (Current)','Time Offset (Normal)','Time (Current)','Time (Normal)','Daylight In Effect','Time Zone','Connectivity','Mobile Broadband','OS Version','PowerShell Version','Video Card Version','BIOS Version','Mother Board Version','Serial Number (BIOS)','Serial Number (Mother Board)','Serial Number (OS)','UUID'
$obj_osinfo_selection.PSObject.TypeNames.Insert(0,"OSInfo")
Write-Output $obj_osinfo_selection
$empty_line | Out-String
$empty_line | Out-String
# Retrieve additional disk information from volumes (Win32_Volume)
$volumes_query = Get-WmiObject -class Win32_Volume -ComputerName $name
ForEach ($volume in $volumes_query) {
$volumes += $obj_volumes = New-Object -TypeName PSCustomObject -Property @{
'Automount' = $volume.Automount
'Block Size' = $volume.BlockSize
'Boot Volume' = $volume.BootVolume
'Compressed' = $volume.Compressed
'Computer' = $volume.SystemName
'DeviceID' = $volume.DeviceID
'Drive' = $volume.DriveLetter
'DriveType' = $volume.DriveType
'File System' = $volume.FileSystem
'Free Space' = (ConvertBytes($volume.FreeSpace))
'Free (%)' = $free_percentage = If ($volume.Capacity -gt 0) {
$relative_free = [Math]::Round((($volume.FreeSpace / $volume.Capacity) * 100 ), 1)
[string]$relative_free + ' %'
} Else {
[string]''
} # else (if)
'Indexing Enabled' = $volume.IndexingEnabled
'Label' = $volume.Label
'PageFile Present' = $volume.PageFilePresent
'Root' = $volume.Name
'Serial Number (Volume)' = $volume.DeviceID
'Source' = $volume.__CLASS
'System Volume' = $volume.SystemVolume
'Total Size' = (ConvertBytes($volume.Capacity))
'Used' = (ConvertBytes($volume.Capacity - $volume.FreeSpace))
'Used (%)' = $used_percentage = If ($volume.Capacity -gt 0) {
$relative_size = [Math]::Round(((($volume.Capacity - $volume.FreeSpace) / $volume.Capacity) * 100 ), 1)
[string]$relative_size + ' %'
} Else {
[string]''
} # else (if)
} # New-Object
} # ForEach ($volume}
} # ForEach ($name/first)
# Write the Computer info and a partition table to a HTML-file
# Define the header of the HTML-file
$html_header = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="Description" content="Computer Info" />
<title>Computer Info</title>
<style type="text/css">
body {
background-color: ' + $background_color + ';
}
.title {
text-align: center;
font-family: "' + $title_font_family + '";
font-size: ' + $title_font_size + ';
font-weight: bold;
background-color: ' + $title_bg_color + ';
border: 0px solid black;
padding: 14px;
}
.headings {
text-align: center;
font-family: "' + $heading_font_family + '";
font-size: ' + $heading_font_size + ';
font-weight: bold;
background-color: ' + $heading_name_bg_color + ';
border: 0px solid black;
padding: 14px;
}
.data {
font-family: "' + $data_font_family + '";
font-size: ' + $data_font_size + ';
text-align: center;
border: 0px solid black;
padding: 10px;
}
#main {
border: 0px solid black;
border-collapse: collapse;
margin-left: 5em;
}
#main tr:nth-child(odd) {
background-color: ' + $data_alternating_row_color_odd + ';
}
#main tr:nth-child(even) {
background-color: ' + $data_alternating_row_color_even + ';
}
p {
font-size: 9px;
font-family: Calibri, "Lucida Sans", Helvetica, sans-serif;
}
.stats {
font-size: 9px;
font-family: Calibri, "Lucida Sans", Helvetica, sans-serif;
}
table.stats th {
border: 0px solid black;
text-align: left;
}
table.stats td {
border: 0px solid black;
text-align: left;
}
#legend {
border: 1px solid black;
position: absolute;
right: 4em;
top: 4em;
padding: 2px;
}
</style>
</head>
<body>'
# Write the header to the HTML-file
Add-Content $html_file -Value $html_header
# Write the Computer info -table and the headers of the main table
Add-Content $html_file -Value ("
<h3>Computer Info</h3>
<table class='stats'>
<tr>
<th>Generated:</th>
<td>" + $date + "</td>
</tr>
<tr>
<th>Computer:</th>
<td>" + $host_name + "</td>
</tr>
<tr>
<th>Manufacturer:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Manufacturer') + "</td>
</tr>
<tr>
<th>Computer Model:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Computer Model') + "</td>
</tr>
<tr>
<th>System Type:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'System Type') + "</td>
</tr>
<tr>
<th>Domain Role:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Domain Role') + "</td>
</tr>
<tr>
<th>Product Type:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Product Type') + "</td>
</tr>
<tr>
<th>Chassis:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Chassis') + "</td>
</tr>
<tr>
<th>PC Type:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'PC Type') + "</td>
</tr>
<tr>
<th>Is a Laptop?</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Is a Laptop?') + "</td>
</tr>
<tr>
<th>Model Version:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Model Version') + "</td>
</tr>
<tr>
<th>CPU:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'CPU') + "</td>
</tr>
<tr>
<th>Video Card:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Video Card_br') + "</td>
</tr>
<tr>
<th>Resolution:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Resolution_br') + "</td>
</tr>
<tr>
<th>Operating System:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Operating System') + "</td>
</tr>
<tr>
<th>Architecture:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Architecture') + "</td>
</tr>
<tr>
<th>Windows Edition ID:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Windows Edition ID') + "</td>
</tr>
<tr>
<th>Windows Installation Type:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Windows Installation Type') + "</td>
</tr>
<tr>
<th>Windows Platform:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Windows Platform') + "</td>
</tr>
<tr>
<th>Type:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Type') + "</td>
</tr>
<tr>
<th>SP Version:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'SP Version') + "</td>
</tr>
<tr>
<th>Windows BuildLab Extended:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Windows BuildLab Extended') + "</td>
</tr>
<tr>
<th>Windows BuildLab:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Windows BuildLab') + "</td>
</tr>
<tr>
<th>Windows Build Branch:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Windows Build Branch') + "</td>
</tr>
<tr>
<th>Windows Build Number:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Windows Build Number') + "</td>
</tr>
<tr>
<th>Windows Release Id:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Windows Release Id') + "</td>
</tr>
<tr>
<th>Current Version:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Current Version') + "</td>
</tr>
<tr>
<th>Memory:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Memory') + "</td>
</tr>
<tr>
<th>Video Card Memory:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Video Card Memory_br') + "</td>
</tr>
<tr>
<th>Logical Processors:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Logical Processors') + "</td>
</tr>
<tr>
<th>Cores:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Cores') + "</td>
</tr>
<tr>
<th>Physical Processors:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Physical Processors') + "</td>
</tr>
<tr>
<th>Country Code:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Country Code') + "</td>
</tr>
<tr>
<th>OS Language:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'OS Language') + "</td>
</tr>
<tr>
<th>Video Card Driver Date:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Video Card Driver Date_br') + "</td>
</tr>
<tr>
<th>BIOS Release Date:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'BIOS Release Date') + "</td>
</tr>
<tr>
<th>OS Install Date:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'OS Install Date') + "</td>
</tr>
<tr>
<th>Last BootUp:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Last BootUp') + "</td>
</tr>
<tr>
<th>UpTime:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'UpTime') + "</td>
</tr>
<tr>
<th>Date:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Date') + "</td>
</tr>
<tr>
<th>Daylight Bias:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Daylight Bias') + "</td>
</tr>
<tr>
<th>Time Offset (Current):</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Time Offset (Current)') + "</td>
</tr>
<tr>
<th>Time Offset (Normal):</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Time Offset (Normal)') + "</td>
</tr>
<tr>
<th>Time (Current):</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Time (Current)') + "</td>
</tr>
<tr>
<th>Time (Normal):</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Time (Normal)') + "</td>
</tr>
<tr>
<th>Daylight In Effect:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Daylight In Effect') + "</td>
</tr>
<tr>
<th>Time Zone:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Time Zone') + "</td>
</tr>
<tr>
<th>Connectivity:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Connectivity_br') + "</td>
</tr>
<tr>
<th>Mobile Broadband:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Mobile Broadband_br') + "</td>
</tr>
<tr>
<th>OS Version:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'OS Version') + "</td>
</tr>
<tr>
<th>PowerShell Version:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'PowerShell Version') + "</td>
</tr>
<tr>
<th>Video Card Version:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Video Card Version_br') + "</td>
</tr>
<tr>
<th>BIOS Version:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'BIOS Version') + "</td>
</tr>
<tr>
<th>Mother Board Version:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Mother Board Version') + "</td>
</tr>
<tr>
<th>Serial Number (BIOS):</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Serial Number (BIOS)') + "</td>
</tr>
<tr>
<th>Serial Number (Mother Board):</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Serial Number (Mother Board)') + "</td>
</tr>
<tr>
<th>Serial Number (OS):</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'Serial Number (OS)') + "</td>
</tr>
<tr>
<th>UUID:</th>
<td>" + ($osinfo | Select-Object -ExpandProperty 'UUID') + "</td>
</tr>
</table>
<br />
<br />
<table id='main'>
<tr>
<td colspan='15' class='title'>" + "$(($available_computers -join ', ').ToUpper())" + "</td>
</tr>
<tr>
<td class='headings'>Computer</td>
<td class='headings'>Drive</td>
<td class='headings'>Label</td>
<td class='headings'>File System</td>
<td class='headings'>Description</td>
<td class='headings'>Partition</td>
<td class='headings'>Disk</td>
<td class='headings'>Disk Model</td>
<td class='headings'>Compressed</td>
<td class='headings'>Used</td>
<td class='headings'>Used %</td>
<td class='headings'>Status</td>
<td class='headings'>Total Size</td>
<td class='headings'>Free Space</td>
<td class='headings'>Free %</td>
</tr>")
# Create a partition table with WMI
ForEach ($name in $available_computers) {
# Increment the step counter
$task_number++