-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcluchkdev.ps1
More file actions
7222 lines (6587 loc) · 413 KB
/
cluchkdev.ps1
File metadata and controls
7222 lines (6587 loc) · 413 KB
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
<#
.Synopsis
S2D Ready Node Deployment Checker
.DESCRIPTION
Script to verify the Dell S2D Ready Node Deployment guide was implemented fully
.CREATEDBY
Jim Gandy
and others
.NOTES
The script can be called without any parameters
examples:
.\CluChk.ps1
.\CluChk.ps1 -runType 3 -uploadToAzure $false -SDDCInputFolder 'C:\customer logs\Customer X - HCI\HealthTest-OL-P-HCI-CL01-20230308-1618\'
.Parameter runType
Specifies what to process, values are the same as menu values
.Parameter SDDCInputFolder
Location of the extracted SDDC collection
.Parameter TSRInputFolder
Locaton of the TSR/Support Assist files
.Parameter STSInputFolder
Location of the Show Tech support files
.Parameter uploadToAzure
Specifies if the collected data should be uploaded in Azure for analysis
.Parameter debug
Specifies to show debug information
.UPDATES
2025/11/xx:v1.77 - 1. New Update: TP - New version 1.77 DEV
2. Bug Fix: TP - Fixed issue where duplicate cluster node entries are created
3. Bug Fix: TP - Fixed issue where the archive Support Matrix was not used.
4. Bug Fix: TP - Changed the SM data variable and related tables to work with the archive matrix.
2025/10/20:v1.76 - 1. New Update: TP - New version 1.76 DEV
2. New Update: TP - Added Priority/Pri to the Cluster Groups and VM Info tables for both clustered and local VMs.
3. Bug Fix: TP - JG noticed VD fault resiliency not longer marks parity volumes with a warning.
4. Bug Fix: TP - 14g S2d ready nodes not showing driver vesion for N-1. Added check for N-2.
5. Bug Fix: SA - Fix Memory warning
2025/10/03:v1.75 - 1. New Update: TP - New version 1.75 DEV
2. New Update: TP - Added resolution for CauReport WSMan provider error in latest action plan
3. New Update: TP - Added RPs not registered to latest action plan
4. Bug Fix: TP - From JF, if a node is down it may show up multiple times in Cluster Node table.
2025/09/24:v1.74 - 1. New Update: TP - New version 1.74 DEV
2. Bug Fix: SA - Fix for single node cluster
3. Bug Fix: SA - Fix for OEM Support Provider check
4. Bug Fix: SA - Physical disk in storagepool on a single node cluster
5. Bug Fix: SA - Vitrual disk in storagepool on a single node cluster
6. New Feature: TP - Searches latest ECE etl for SBE content issue
7. New Feature: TP - Create DHealthTest junction in user profile to avoid long path errors
8. New Feature: TP - If SU/SBE is not Installed or Obsolete then show latest as Next MS SU or Next SBE
9. New Feature: TP - Request from LA, ProvisioningType for Virtual Disks
10. New Feature: TP - LA Request, mark non-converged non-storage nics as yellow for enabled Net QOS
2025/09/15:v1.73 - 1. New Update: TP - New version 1.73 DEV
2. Bug Fix: TP - Set date for 11.x to 12.x update to Oct 10th, 2025
2025/09/08:v1.72 - 1. New Update: TP - New version 1.72 DEV
2. Bug Fix: SA - Remove trailing slash
3. Bug Fix: SA - Removed hard PageFile check for 24h2
4. Bug Fix: TP - Some systems were not finding the Compression module.
5. Bug Fix: TP - Intel E810 driver version does not match. Support Matrix is 24, real driver is 1.17.73.0
6. New Feature: TP - In Physical Disks show CannotPoolReason.
2025/08/28:v1.71 - 1. New Update: TP - New version 1.71 DEV
2. Bug Fix: TP - When finding updates in the support matrix also restrict by server model.
3. Bug Fix: TP - Broadcom 25gb SFP nics were no longer getting the correct driver version.
4. Bug Fix: TP - Recommended updates for Azure systems without MS Solution Updates were incorrect
5. New Update: TP - Mark SBE/SU version older than 6 months as an Error instead of a Warning and show correct next version.
6. New Update: TP - Get Last AP Failure from all ECE zips and show Exception in the Latest Action Plan Failure table
7. Bug Fix: TP - Remove APEX from showing errors on Update Out of Box drivers and show Mellanox driver version correctly.
8. Bug Fix: TP - Ignore VMQ and Jumbo Frames issues if cluster is using a converged network.
9. New Update: TP - Added Type column to NetworkATC table.
2025/08/19:v1.70 - 1. New Update: TP - New version 1.70 DEV
2. New Update: TP - Added 24H2 to several areas. We'll have to double check this works as expected.
3. New Update: TP - $GenerationNodes added AMD AX 15g systems
4. New Update: TP - If system model not found in latest support matrix, tries the next one.
5. Bug Fix: TP - If solution is on 11.x, then do not show 12.x MS solution updates until 9/15/2025.
2025/07/25:v1.69 - 1. New Update: TP - New version 1.69 DEV
2. New Update: TP - Added test-environment check for Last Action Plan Failure
3. New Feature: TP - Mark mismatched UBR build numbers as errors
4. New Update: TP - Pull system information into the html table if using the MS version of the SDDC
2025/07/10:v1.68 - 1. New Update: TP - New version 1.68 DEV
2. New Update: TP - If a vm switch has no virtual adapter will mark RED with Note about health checks failing
3. New Update: TP - Reads GetActionPlanInstancesToComplete to find Errors. More to be done.gci
4. Bug Fix: TP - Fixed Update Out of Box drivers now that we use the new method for the support matrix.
2025/06/23:v1.67 - 1. New Update: TP - New version 1.67 DEV
2. New Update: JG - Rewrote the Support Matrix scrapter to use API instead of HTML parsing
3. New Update: JG - Rewrote Convert-HtmlTableToPsObject to account for possible Null values
4. New Update: JG - Physical Disks - Updated for all the changes to SM Scrapter & Convert-HtmlTableToPsObject
5. New Update: JG - Physical Disks - Added Kioxia drives to the table
6. New Update: JG - $GenerationNodes added AX740XD support
7. New Update: TP - $GenerationNodes added R?40?? Storage Spaces Direct support
8. New Feature: TP - Change all throw commands to Write-Warning so script will not stop
9. New Feature: TP - Only Invoke HTML file if CluChk is run on a system with a browser
2025/05/16:v1.66 - 1. New Update: TP - New version 1.66 DEV
2. New Feature: TP - New tables for updates on Azure local 23H2 and Apex
3. New Feature: TP - Added new table Solution and SBE Updates
4. New Feature: TP - Check for CAU Role Automatic Updates
2025/05/14:v1.65 - 1. New Update: TP - New version 1.65 DEV
2. Bug Fix: SA - Suppress remove old logfile error
3. Bug Fix: SA - Only warn if pagefile is larger than expected
4. Bug Fix: SA - Include FIPS disks in firmware check
5. Bug Fix: SA - Fix Recommended Updates and Hotfixes sorting, first per node (Asc), then per KB (Desc)
6. Bug Fix: SA - More minor sort fixes
7. Bug Fix: SA - Added Windows Server 2025 version
8. New Feature: SA - Add Azure Local version in Cluster node table
9. New Feature: SA - Check if Azure version is same on all nodes
10. New Feature: TP - Added check and error for mismatched time zones on nodes
11. Bug Fix: JG - Repaired the Show Tech Report as is was not working and slow
2025/04/29:v1.64 - 1. New Update: TP - New version 1.64 DEV
2. Bug Fix: TP - Support Matrix changed link title from Azure Stack HCI to Azure Local. Updated the code.
2025/05/xx:v1.63 - 1. New Update: TP - New version 1.63 DEV
2. New Feature: TP - If SysInfo cannot be gathered, still show the node in the Cluster Nodes table.
3. New Feature: TP - Call out simple virtual disks.
2025/04/02:v1.62 - 1. New Update: TP - New version 1.62 DEV
2. Bug Fix: TP - Adding timeoutsec to all Invoke-WebRequests to 30 seconds.
3. Bug Fix: TP - Do not show error for E810 adapters using RoCEv2
2025/01/23:v1.61 - 1. New Update: TP - New version 1.61 DEV
2. Bug Fix: SA - Corrected APEX ISM IP, should be 169.254.0.1
3. New Update: JG - Added new FLTMCXml file processing
4. Bug Fix: JL - Updated Jumbo Frames section
5. Bug Fix: JL - Added fix and sorting to FLTMCXml processing
2024/12/11:v1.60 - 1. New Update: TP - New version 1.60 DEV
2. Bug Fix: TP - Do not show Management network as Red for LM if it's a regular PowerEdge server.
3. New Feature: TP - Cluster only networks show RED if excluded from live migration for Apex/HCI
4. Bug Fix: SA - Added Dell Ent NVMe CM7 disk model
5. Bug Fix: SA - Trim firmware results from support matrix
2024/10/31:v1.59 - 1. New Update: JG - New version 1.59 DEV
2. Bug Fix: SA - Fixed sorting/label in Host Management VLAN table
3. Bug Fix: SA - Fixed some more sorting issues
4. Bug Fix: SA - Fixed SMB signing required for 23h2
5. Bug Fix: SA - Fixed firmware catalog selection 14g/15g vs 16g
6. Bug Fix: SA - Hack for Broadcom driver version
7. Bug Fix: SA - Added warning for no SBE package validation on 23h2 and APEX
8. Bug Fix: SA - Added AX-45?0 node types to generations
9. Bug Fix: SA - Fixed catalog selection on unknown node generation
10. Bug Fix: TP - Added "DvFlt","MdvFsFlt","applockerfltr" to show as MS FLTMC drivers.
11. New Feature: SA - Added ISM IP checker
12. Bug Fix: SA - Some RED fixes
13. Bug Fix: SA - Suppress runspace output
2024/08/21:v1.58 - 1. Bug Fix: TP - Fixed FileSystem field for Virtual Disks table
2. Bug Fix: TP - Fixed Virtual Disk status not showing on updated systems.
3. New Feature: TP - Show warning instead of failure when not able to down support matrix.
4. Bug Fix TP - Change Drift run code due to errors on some systems.
5. New Feature: TP - Set URL for 2016 HCI solutions to the archive support matrix page.
6. Bug Fix: SA - Fixed some text
7. New Feature: JG - NetAdapterAdvancedProperty - Exclude Host in Charge check for APEX
8. New Feature: JG - Cluster Nodes - Added UBR
2024/06/12:v1.57 - 1. Bug Fix: TP - Ignore NetATC overrides on 23H2
2. Bug Fix: TP - Do not gather Windows updates for 23H2
2024/05/09:v1.56 - 1. Bug Fix:JG - Added -UseBasicParsing to all Invoke-WebRequests for Server OS compatability
2. Bug Fix:TP - If CSV name and Volume name does not match make file system type blank instead of NTFS
2024/04/09:v1.55 - 1. New Feature:TP - Drift moved to GitHub
2024/04/05:v1.54 - 1. Bug Fix:TP - Fixed Computer Nodes section missing due to previous fix.
2024/04/03:v1.53 - 1. Bug Fix:TP - If IOV is enabled ignore the BandwidthReservationMode and BandwidthPercentage settings
2. New Feature:TP - On LRs request, check for Mixed Mode clusters and show a problem in the Cluster Name object
3. Bug Fix: Using GetComputerInfo.xml instead of SystemInfo.txt because it seems to gather more reliabily
4. New Feature: JG - Added Invoke-RunCluChk
2024/03/13:v1.52 - 1. New Feature: TP - Change HTML Agility pack to only download if not in C:\ProgramData\Dell\htmlagilitypack
2. New Feature: JG - Added APEX version to OSVersionNodes so that 23H2 will be red for non-APEX until we support it
3. New Feature: JG/TP - Cluster Heartbeat Configuration - Added check for Stretch Cluster heartbeat settings
4. Bug Fix: TP - Fixed an issue with System Page file that I caused in 1.51
5. Bug Fix: TP - Net Qos Dcbx Property table was not flagging Firmware in Charge as an Error
6. New Feature: TP - Added the file system to Cluster Shared Volumes
7. Bug Fix: TP - Net QOS Traffic Class was calling out ETS as an error when it is configured correctly.
8. New Feature: TP - Wrote PS Function to pull HTML tables. Removed downloading HTMLAgilityPack and changed sections using it.
2024/02/09:v1.51 - 1. New Feature: TP - Call out a warning for a Cluster network with an IP but the Cluster Role set to None
2. New Feature: JG - Jumbo Frames: Changes Slot to Port and added Intel Nics for APEX support
3. New Feature: JG - Net Adapter Qos: ONLY check if Quality Of Service for APEX support
4. Bug Fix: TP - Qos DBCX settings did not show the Node name
5. New Feature: JG - Cluster Name: Added 23H2 for APEX support
6. New Feature: JG - Cluster Nodes: Added 25398 to OSBuild for APEX support
7. Bug Fix: JG - Net Qos Dcbx Property: Do not show if no dhbxmode found
2024/01/25:v1.50 - 1. New Feature: JG - Cluster Nodes - Added check for EoL Operation Systems
2. Bug Fix: TP - Fixed disk firmware showing older firmware preferred if two are in the support matrix
3. Bug Fix: TP - Fixed Storage Network Cards and Node map due to changing to using jobs for all commands
4. Bug Fix: TP - Net QOS traffic class not showing correctly
5. New Feature: TP - Added unknown Net QOS Traffic Classes to the table
6. Bug Fix: TP - Change OEM Support Provider to only call out if it does not contain 'dell'
See previous version for update notes
#>
`
Function Invoke-RunCluChk{
param (
[int]$runType = 0,
[string]$SDDCInputFolder = '',
[string]$TSRInputFolder = '',
[string]$STSInputFolder = '',
[boolean]$uploadToAzure = $false,
[boolean]$debug = $false
)
$CluChkVer="1.77DEV"
#Fix "The response content cannot be parsed because the Internet Explorer engine is not available"
try {Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Internet Explorer\Main" -Name "DisableFirstRunCustomize" -Value 2} catch {}
#region Variable Cleanup
#The following line causes alot of errors and does not appear to accomplish what is required.
# Remove-Variable * -Scope Local -ErrorAction SilentlyContinue
# Recommend using a prefix on variables so remove-variable can -include prefix*
$TLogLoc = "C:\programdata\Dell\CluChk"
$DateTime=Get-Date -Format yyyyMMdd_HHmmss;Start-Transcript -NoClobber -Path "$TlogLoc\CluChk_$DateTime.log"
[system.gc]::Collect()
#endregion
# Function to convert HTML table to PowerShell objects
function Convert-HtmlTableToPsObject {
param (
[string]$HtmlContent
)
$tableRegex = '(?s)<h3 id="([^"]+)">(.*?)</h3>.*?<table[^>]*>(.*?)</table>'
$tableNoNameRegex = '(?s)<table[^>]*>(.*?)</table>'
$rowRegex = '<tr[^>]*>(.*?)</tr>'
$thCellRegex = '<th[^>]*>(.*?)</th>'
$tdCellRegex = '(.*?)</td>'
$rowSpanRegex = 'rowspan="(\d+)"'
$NoName = $false
$tableMatches = [regex]::Matches($HtmlContent, $tableRegex)
if ($tableMatches.Count -eq 0) {
$tableMatches = [regex]::Matches($HtmlContent, $tableNoNameRegex)
$NoName = $true
}
$result = @{}
$tableNo = 0
foreach ($tableMatch in $tableMatches) {
if ($NoName) {
$tableName = $tableNo
$tableNo++
$tableHtml = $tableMatch.Groups[1].Value
} else {
$tableName = $tableMatch.Groups[2].Value
$tableHtml = $tableMatch.Groups[3].Value
}
$headers = @()
[regex]::Matches($tableHtml, $thCellRegex) | ForEach-Object {
$header = $_.Groups[1].Value.Trim()
if (-not $header) { $header = "Column$($headers.Count + 1)" }
$headers += $header
}
$rowMatches = [regex]::Matches($tableHtml, $rowRegex)
if ($rowMatches.count -eq 0) {$rowMatches = [regex]::Matches(($tablehtml -replace '[^\w\d<>/\b \b\.\-]',''), $rowRegex)}
$rows = @()
$rowIndex = 0
foreach ($rowMatch in ($rowMatches | Select-Object -Skip 1)) {
$rowHtml = $rowMatch.Groups[1].Value
$cellMatches = [regex]::Matches($rowHtml, $tdCellRegex)
$rowData = @{}
$colIndex = 0
foreach ($cellMatch in $cellMatches) {
if ($colIndex -ge $headers.Count) { continue }
$curHeader = $headers[$colIndex]
$cell = $cellMatch.Groups[1].Value
if ($cell) {
$cell = $cell -replace "<td[^>]*>", ""
$cell = $cell.Trim()
} else {
$cell = $null
}
$rowSpan = 1
$splitCells = $rowHtml -split '</td>'
if ($colIndex -lt $splitCells.Count) {
$rowSpanMatch = [regex]::Match($splitCells[$colIndex], $rowSpanRegex)
if ($rowSpanMatch.Success) {
$rowSpan = [int]$rowSpanMatch.Groups[1].Value
}
}
$rowData[$curHeader] = $cell
if ($rowSpan -gt 1) {
for ($j = 1; $j -lt $rowSpan; $j++) {
$targetIndex = $rowIndex + $j
while ($rows.Count -le $targetIndex) {
$rows += @{}
}
$rows[$targetIndex][$curHeader] = $cell
}
}
$colIndex++
}
while ($rows.Count -le $rowIndex) {
$rows += @{}
}
foreach ($k in $rowData.Keys) {
$rows[$rowIndex][$k] = $rowData[$k]
}
$rowIndex++
}
$psRows = $rows | ForEach-Object { [PSCustomObject]$_ }
$result[$tableName] = $psRows
}
return $result
}
#region Cleanup CluChk Transcripts older than 10 days
function TLogCleanup {
Get-ChildItem $TlogLoc -ErrorAction SilentlyContinue | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-10)} | Foreach {Remove-Item $_.Fullname -force -ErrorAction SilentlyContinue}
# Cleanup chipset extract
Remove-Variable IntelChipset* -Scope Local -ErrorAction SilentlyContinue
IF($IntelChipsetDownloadLocation){Remove-Item $IntelChipsetDownloadLocation}
IF($IntelChipsetDupExtractLocation){Remove-Item $IntelChipsetDupExtractLocation -Recurse}
}
#endregion
# Create a unique Guid to use for file names
$CluChkGuid=(New-Guid).GUID
#endregion
<#
#Async download of Agility pack
Start-Job -Name "AgilityPack" -ScriptBlock {
# Download htmlagilitypack
If (!(Get-ChildItem -Path "C:\ProgramData\Dell\htmlagilitypack" -ErrorAction SilentlyContinue -Recurse -Filter 'Net45' | Get-ChildItem | Where-Object{$_.Name -imatch 'HtmlAgilityPack.dll'}).count) {
try {
invoke-webrequest -Uri "https://www.nuget.org/api/v2/package/HtmlAgilityPack\1.11.46" -OutFile "$env:TEMP\htmlagilitypack.nupkg.zip" -TimeoutSec 30
}
catch {
Write-Warning ('Unable to download HTMLAgilityPack')
}
finally {
# Find the htmlagilitypack.dll
Expand-Archive "$env:TEMP\htmlagilitypack.nupkg.zip" -DestinationPath "C:\ProgramData\Dell\htmlagilitypack" -force -ErrorAction SilentlyContinue
}
}}
#>
Function EndScript{
For ($i=0; $i -le 100; $i++) {
Start-Sleep -Milliseconds 5
Write-Progress -Activity "Exit Timer" -Status " " -PercentComplete $i
}
break script
}
$WhatsNew=@"
1. in dev
"@
#region Opening Banner and menu
if (!$runType) {Clear-Host}
$text = @"
v$CluChkVer
_____ _ _____ _ _
/ ____| | ___ / ____| | | |
| | | |_ _| | | |__ | | __
| | | | | | | | | '_ \| |/ /
| |____| | |_| | |____| | | | <
\_____|_|\__,_|\_____|_| |_|_|\_\
by: Jim Gandy
"@
$Oops=@"
Oops... Something went wrong. Please try again.
"@
Write-Host $text
Write-Host ""
# Run Menu
Function ShowMenu{
do
{
$Global:selection=""
Clear-Host
Write-Host $text
Write-Host ""
Write-Host "============ Please make a selection ==================="
Write-Host ""
Write-Host "Press '1' to Process Show Tech-Support(s)"
Write-Host "Press '2' to Process Support Assist Collection(s)"
Write-Host "Press '3' to Process PrivateCloud.DiagnosticInfo (SDDC)"
Write-Host "Press '4' to Process S2D\HCI Performance Report"
Write-Host "Press '5' to Process All the above"
Write-Host "Press 'H' to Display Help"
Write-Host "Press 'Q' to Quit"
Write-Host ""
$Global:selection = Read-Host "Please make a selection"
}
until ($Global:selection -match '[1-5,qQ,hH]')
$Global:ProcessSTS = "N"
$Global:ProcessSDDC = "N"
$Global:ProcessTSR = "N"
$Global:ProcessPerformanceReport = "N"
IF($selection -imatch 'h'){
Clear-Host
Write-Host ""
Write-Host "What's New in"$CluChkVer":"
Write-Host $WhatsNew
Write-Host ""
Write-Host "Usage:"
Write-Host " Make a selection by entering a comma delimited string of numbers from the menu."
Write-Host ""
Write-Host " Example: 1 will process Show Tech-Support(s) only and create a report."
Write-Host " Show Tech-Support is a log collection from a Dell switch."
Write-Host ""
Write-Host " Example: 1,3 will process Show Tech-Support(s) and "
Write-Host " PrivateCloud.DiagnosticInfo (SDDC) and create a report."
Write-Host ""
Pause
ShowMenu
}
IF($Global:selection -match 1){
Write-Host "Process Show Tech-Support(s)..."
$Global:ProcessSTS = "Y"
}
IF($Global:selection -match 2){
Write-Host "Process Support Assist Collection(s)..."
$Global:ProcessTSR = "Y"
}
IF($Global:selection -match 3){
Write-Host "Process PrivateCloud.DiagnosticInfo (SDDC)..."
$Global:ProcessSDDC = "Y"
}
IF($Global:selection -match 4){
Write-Host "Process SDDC Performance Report..."
$Global:ProcessPerformanceReport = "Y"
#Enabled to get the SDDC then disabled once we have it
$Global:ProcessSDDC = "Y"
}
ElseIF($Global:selection -eq 5){
Write-Host "Process Show Tech-Support(s) + Support Assist Collection(s) + PrivateCloud.DiagnosticInfo (SDDC) + SDDC Performance Report..."
$Global:ProcessSTS = "Y"
$Global:ProcessSDDC = "Y"
$Global:ProcessTSR = "Y"
$Global:ProcessPerformanceReport = "Y"
}
IF($Global:selection -imatch 'q'){
Write-Host "Bye Bye..."
EndScript
}
}#End of ShowMenu
#endregion
if ($runType -eq 0) {
ShowMenu
} else {
$Global:ProcessSTS = "N"
$Global:ProcessSDDC = "N"
$Global:ProcessTSR = "N"
$Global:ProcessPerformanceReport = "N"
switch ($runType) {
1 {$Global:ProcessSTS = "Y"}
2 {$Global:ProcessTSR = "Y"}
3 {$Global:ProcessSDDC = "Y"}
4 {
$Global:ProcessPerformanceReport = "Y"
$Global:ProcessSDDC = "Y"
}
5 {
$Global:ProcessSTS = "Y"
$Global:ProcessSDDC = "Y"
$Global:ProcessTSR = "Y"
}
}
}
Set-Variable -Name htmlout -Scope Global
#region Telemetry Information
Write-Host "Logging Telemetry Information..."
function add-TableData {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string] $tableName,
[Parameter(Mandatory = $true)]
[string] $PartitionKey,
[Parameter(Mandatory = $true)]
[string] $RowKey,
[Parameter(Mandatory = $true)]
[array] $data,
[Parameter(Mandatory = $false)]
[array] $SasToken
)
if ($uploadToAzure) {
$storageAccount = "gsetools"
# Allow only add and update access via the "Update" Access Policy on the CluChkTelemetryData table
# Ref: az storage table generate-sas --connection-string 'USE YOUR KEY' -n "CluChkTelemetryData" --policy-name "Update"
If(-not($SasToken)){
$sasWriteToken = "?sv=2017-04-17&si=Update&tn=CluChkTelemetryData&sig=NP2ZQnHuUhOAOyGhzd94GVbKrBqhYlIKjX%2BVrhAjFoE%3D"
}Else{$sasWriteToken=$SasToken}
$resource = "$tableName(PartitionKey='$PartitionKey',RowKey='$Rowkey')"
# should use $resource, not $tableNmae
$tableUri = "https://$storageAccount.table.core.windows.net/$resource$sasWriteToken"
# Write-Host $tableUri
# should be headers, because you use headers in Invoke-RestMethod
$headers = @{
Accept = 'application/json;odata=nometadata'
}
$body = $data | ConvertTo-Json
#This will write to the table
#write-host "Invoke-RestMethod -Method PUT -Uri $tableUri -Headers $headers -Body $body -ContentType application/json"
try {
$item = Invoke-RestMethod -Method PUT -Uri $tableUri -Headers $headers -Body $body -ContentType application/json
} catch {
#write-warning ("table $tableUri")
#write-warning ("headers $headers")
}
} # if upload
}# End function add-TableData
# Generating a unique report id to link telemetry data to report data
$CReportID=""
$CReportID=(new-guid).guid
# Get the internet connection IP address by querying a public API
#$internetIp = (invoke-webrequest -uri "http://ifconfig.me/ip" -UseBasicParsing).Content
# Define the API endpoint URL
$geourl = "http://ip-api.com/json" #$geourl = "http://ip-api.com/json/$internetIp"
# Invoke the API to determine Geolocation
$response = Invoke-RestMethod $geourl
$data = @{
Region=$env:UserDomain
Version=$CluChkVer
ReportID=$CReportID
country=$response.country
counrtyCode=$response.countryCode
georegion=$response.region
regionName=$response.regionName
city=$response.city
zip=$response.zip
lat=$response.lat
lon=$response.lon
timezone=$response.timezone
}
$RowKey=(new-guid).guid
$PartitionKey="CluChk"
#Make sure we get telemetry if uploadToAzure = $False
If($uploadToAzure -eq $false){
$uploadToAzure = $true
add-TableData -TableName "CluChkTelemetryData" -PartitionKey $PartitionKey -RowKey $RowKey -data $data
$uploadToAzure=$false
}Else{add-TableData -TableName "CluChkTelemetryData" -PartitionKey $PartitionKey -RowKey $RowKey -data $data}
#endregion End of Telemetry data
# unzip files
function Unzip {
param([string]$zipfile, [string]$outpath)
Write-Host " Expanding: "
Write-Host " $SDDCLoc "
Write-Host " To:"
Write-Host " $ExtracLoc"
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
}
Function Get-FileName([string]$initialDirectory, [string]$infoTxt, [string]$filter) {
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog -Property @{MultiSelect = $true}
$OpenFileDialog.Title = $infoTxt
$OpenFileDialog.initialDirectory = $initialDirectory
$OpenFileDialog.filter = $filter
$OpenFileDialog.ShowDialog() | Out-Null
$OpenFileDialog.filenames
}
#region Ask for Show Tech-Support files
#$ProcessSTS = Read-Host "Would you like to process Show Tech-Supports? [y/n]"
IF($ProcessSTS -ieq "y"){
if ($STSInputFolder -eq '') {
Write-Host "Please Select Show Tech-Support File(s) to use..."
$STSLOC = Get-FileName "$env:USERPROFILE\Documents\SRs" "Please Select Show Tech-Support File(s)." "Logs (*.zip,*.txt,*.log)| *.zip;*.TXT;*.log"
} else {
$STSLOC = $STSInputFolder
}
If ($STSLOC.length -eq 0) {
Write-Host " ERROR: Empty path given. Existing" -ForegroundColor Red
EndScript
}
if (!(Test-Path -Path $STSLOC)) {
Write-Host " ERROR: STS Path does not exist. Existing" -ForegroundColor Red
EndScript
}
# unzip files
$STSFiles=@()
$CluChkReportLoc=(Split-Path -Path $STSLOC)
$STSExtracLoc=(Split-Path -Path $STSLOC)+"\"+ (Split-Path -Path $STSLOC -Leaf).Split(".")[0]
ForEach($STSFile in $STSLOC){
If($STSFile -imatch '.zip'){
unzip $STSFile $STSExtracLoc
$STSFiles+=(Get-ChildItem $STSExtracLoc).fullName
}Else{$STSFiles+=$STSFile}
}
} # if $ProcessSTS
#endregion
#region $ProcessSDDC = Read-Host "Would you like to process SDDC? [y/n]"
IF($ProcessSDDC -ieq "y"){
Write-Host "Starting SDDC..."
IF($ProcessPerformanceReport -ieq "y"){
$SDDCPerf="YES"
}Else{$SDDCPerf="NO"}
if ($SDDCInputFolder -eq '') {
# no input folder given
# Added to Select-Object the extracted SDDC
$SDDCExtracted = Read-Host " Do you already have an extracted SDDC? [y/n]"
IF($SDDCExtracted -ieq "y") {
$SDDCExtracted="YES"
Write-Host " Please Provide the path to the extracted SDDC. "
Write-Host " Do NOT include Quotes even if path includes spaces."
Write-Host " Ex: c:\SRs\81449725\HealthTest-NL70U00CL02-20200928-1130"
$SDDCPath=Read-Host " Path"
$IR=1
$CluChkReportLoc=Split-Path -Path $SDDCPath
$ExtracLoc=(Split-Path -Path $SDDCPath) +"\"+ (Split-Path -Path $SDDCPath -Leaf).Split(".")[0]
$IncompleteSDDC=$False
If(!(Test-Path -Path (Join-Path $SDDCPath 0_CloudHealthSummary.log))){
If(!(Test-Path -Path (Join-Path $SDDCPath 0_CloudHealthGatherTranscript.log))){
Do{ Write-Host " ERROR: Invalid SDDC Path." -ForegroundColor Red
$SDDCPath = Read-Host "Please try again"
$IR+=$IR++
$CluChkReportLoc=Split-Path -Path $SDDCPath
$ExtracLoc=(Split-Path -Path $SDDCPath) +"\"+ (Split-Path -Path $SDDCPath -Leaf).Split(".")[0]
IF($IR -gt 2){
Write-Host " ERROR: Failed SDDC Path too many times. Extracing again." -ForegroundColor Red
$SDDCExtracted="NO"
break
}}
While((!(Test-Path -Path "$SDDCPath\0_CloudHealthSummary.log")))
} else {
$IncompleteSDDC=$True
Write-Host " WARNING: Incomplete SDDC Capture." -ForegroundColor Yellow
gc (Join-Path $SDDCPath 0_CloudHealthGatherTranscript.log) -tail 10 | %{Write-Host " $_ " -ForegroundColor Yellow}
}
}
}
If($SDDCExtracted -ne "YES"){
Write-Host " Please Select-Object SDDC File to use..."
$SDDCLoc=Get-FileName "$env:USERPROFILE\Documents\SRs" "Please Select SDDC File." "ZIP (*.zip)| *.zip"
if(!$SDDCLoc){EndScript}
#Extraction temp location
$CluChkReportLoc=Split-Path -Path $SDDCLoc
$ExtracLoc=(Split-Path -Path $SDDCLoc) +"\"+ (Split-Path -Path $SDDCLoc -Leaf).Split(".")[0]
Try{
If (Test-Path $ExtracLoc -PathType Container){Remove-Item $ExtracLoc -Recurse -Force -ErrorAction Stop | Out-Null}
}Catch{
Write-Host $Oops
Write-Host ""
Write-Host "$Error" -ForegroundColor Red
EndScript
}
if (!(Test-Path $ExtracLoc -PathType Container)) {New-Item -ItemType Directory -Force -Path $ExtracLoc | Out-Null }
Unzip $SDDCLoc $ExtracLoc
$SDDCPath=$ExtracLoc
$IncompleteSDDC=$False
If(!(Test-Path -Path (Join-Path $SDDCPath 0_CloudHealthSummary.log))){
If(!(Test-Path -Path (Join-Path $SDDCPath 0_CloudHealthGatherTranscript.log))){
Write-Host " ERROR: Invalid SDDC Path." -ForegroundColor Red
break
} else {
$IncompleteSDDC=$True
Write-Host " WARNING: Incomplete SDDC Capture." -ForegroundColor Yellow
gc (Join-Path $SDDCPath 0_CloudHealthGatherTranscript.log) -tail 10 | %{Write-Host " $_ " -ForegroundColor Yellow}
}
}
} # if SDDCInputFolder
} else {
if (!(Test-Path -Path $SDDCInputFolder)) {
Write-Host " ERROR: SDDC Path does not exist. Existing" -ForegroundColor Red
EndScript
}
$SDDCPath = $SDDCInputFolder
$CluChkReportLoc=Split-Path -Path $SDDCPath
}
IF($selection -eq "4"){$Global:ProcessSDDC = "N"}
}
#endregion SDDC Locate and Extract
try {(Get-Item "$($env:USERPROFILE)\DHealthTest" -ErrorAction SilentlyContinue).Delete()} catch {}
$SDDCOldPath=$SDDCPath
If ($SDDCOldPath.Length -gt 90) {
New-Item -ItemType Junction -Path "$($env:USERPROFILE)\DHealthTest" -Target (Split-Path $SDDCPath -Parent) | Out-Null
$SDDCPath="$($env:USERPROFILE)\DHealthTest\"+(Split-Path $SDDCPath -Leaf)
}
#region Ask for TSRs
#$ProcessTSR = Read-Host "Would you like to process TSRs? [y/n]"
IF($ProcessTSR -ieq "y"){
# Show Tech-Support Report
if ($TSRInputFolder -eq '') {
Write-Host "Please Select Support Assist Collection(TSR) File(s) to use..."
$TSRLOC = Get-FileName "$env:USERPROFILE\Documents\SRs" "Please Select Support Assist Collection(TSR) File(s) to use." ""
} else {
$TSRLOC = $TSRInputFolder
}
If ($TSRLOC.length -eq 0) {
Write-Host " ERROR: Empty path given. Existing" -ForegroundColor Red
EndScript
}
if (!(Test-Path -Path $TSRLOC)) {
Write-Host " ERROR: TSR Path does not exist. Existing" -ForegroundColor Red
EndScript
}
$CluChkReportLoc=(Split-Path -Path $TSRLOC)
}
#endregion End Ask for TSRs
Function Convert-BytesToSize
{
<#
.SYNOPSIS
Converts any integer size given to a user friendly size.
.DESCRIPTION
Converts any integer size given to a user friendly size.
.PARAMETER size
Used to convert into a more readable format.
Required Parameter
.EXAMPLE
ConvertSize -size 134217728
Converts size to show 128MB
#>
#Requires -version 2.0
[CmdletBinding()]
Param
(
[parameter(Mandatory=$False,Position=0)][int64]$Size
)
#Decide what is the type of size
Switch ($Size)
{
{$Size -gt 1PB}
{
Write-Verbose "Convert to PB"
$NewSize = "$([math]::Round(($Size / 1PB),2))PB"
Break
}
{$Size -gt 1TB}
{
Write-Verbose "Convert to TB"
$NewSize = "$([math]::Round(($Size / 1TB),2))TB"
Break
}
{$Size -gt 1GB}
{
Write-Verbose "Convert to GB"
$NewSize = "$([math]::Round(($Size / 1GB),2))GB"
Break
}
{$Size -gt 1MB}
{
Write-Verbose "Convert to MB"
$NewSize = "$([math]::Round(($Size / 1MB),2))MB"
Break
}
{$Size -gt 1KB}
{
Write-Verbose "Convert to KB"
$NewSize = "$([math]::Round(($Size / 1KB),2))KB"
Break
}
Default
{
Write-Verbose "Convert to Bytes"
$NewSize = "$([math]::Round($Size,2))Bytes"
Break
}
}
Return $NewSize
}
#region Create HTML file and adding CSSfor output
#$DateTime=Get-date
$DTString=Get-Date -Format "yyyyMMdd_HHmmss_"
$htmlout=""
$html=""
$ResultsSummary=@()
$htmlStyle = @"
<style TYPE="text/css">
TABLE {border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}
TH {border-width: 1px;padding: 3px;border-style: solid;border-color: black;background-color: #6495ED;}
TD {border-width: 1px;padding: 3px;border-style: solid;border-color: black;}
TR:Nth-Child(Even) {Background-Color: #dddddd;}
TR:Hover TD {Background-Color: #C1D5F8;}
h5 {display: block;font-size: .83em;margin-top: 0;margin-bottom: 0;margin-left: 0;margin-right: 0;font-weight: normal;padding: 0;}
h1{border-bottom: 5px solid #f4a460}
mark {
background-color: yellow;
color: black;
}
</style>
<script>
function toggle(ele,cElem) {
var cont = document.getElementById(ele);
cont.style.display = cont.style.display == 'none' ? 'block' : 'none';
cElem.innerText = cElem.innerText == '\u21ca\xa0' ? '\u21c9\xa0' : '\u21ca\xa0';
}
</script>
"@
#endregion
Function Set-ResultsSummary{
Param
(
[Parameter(Mandatory=$true, Position=0)]
[string] $Name,
[Parameter(Mandatory=$true, Position=1)]
[string] $html
)
# Add summary info
#$WarningsCount= 0
#$ErrorsCount= 0
$Table =@()
$Table = [PSCustomObject]@{
Name = $name
Warnings = ($html -split '\<\/tr\>' | Where-Object{$_ -imatch 'ffff00'}| Measure-Object).Count
Errors = ($html -split '\<\/tr\>' | Where-Object{($_ -imatch 'ffffff') -or($_ -imatch 'font color="red"')}| Measure-Object).Count
}
return $Table
} #function Set-ResultsSummary
<#
# Download htmlagilitypack
try {
invoke-webrequest -Uri "https://www.nuget.org/api/v2/package/HtmlAgilityPack/1.11.46" -OutFile "$env:TEMP\htmlagilitypack.nupkg.zip"
}
catch {
Write-Warning ('Unable to download HTMLAgilityPack')
}
# Find the htmlagilitypack.dll
Expand-Archive "$env:TEMP\htmlagilitypack.nupkg.zip" -DestinationPath "$env:TEMP\htmlagilitypack" -force -ErrorAction SilentlyContinue
#>
<#If ((Get-Job -Name "AgilityPack").State -match 'Running') {
write-host ("Waiting on download job to complete")
$loopTimer = 0
$maxTimer = 150
while (((Get-Job -Name "AgilityPack").State -ne 'Completed') -and ($loopTimer -le $maxTimer)){
Sleep -Milliseconds 100
$loopTimer++
}
}
If ((Get-Job -Name "AgilityPack").State -ne 'Completed') {
Write-Host "Could not download Agility Pack" -ForegroundColor Red
Get-Job -Name "AgilityPack" | Receive-Job
Get-Job | Remove-Job -Force
exit
}
Get-Job | Remove-Job -Force
# Import the required libraries windows 10 or above will have .Net 4.5 or greater. Assuming .Net 4.5 lib
Add-Type -Path (Get-ChildItem -Path "C:\ProgramData\Dell\htmlagilitypack" -Recurse -Filter 'Net45' | Get-ChildItem | Where-Object{$_.Name -imatch 'HtmlAgilityPack.dll'}).fullname
#.Net download -
# $webClient.DownloadFile($URL, $OutFile)}
#>
If ($ProcessSDDC -ieq 'y') {
$msinfo=@()
gci $SDDCPath -Recurse -Depth 1 -Filter "msinfo.nfo" | %{$msinfo+=[xml](gc $_.fullname)}
$SysEnvVars=$msinfo | %{$pscn=$_.msinfo.Category.data.value[4].'#cdata-section';(($_.msinfo.Category.Category.category | ? Name -eq "Environment Variables").data | ?{$_.'User_Name' -match "system"} | Select-Object Variable,Value,@{L="PSComputerName";E={$pscn}})}
$SysEnvVars=$SysEnvVars | Select PSComputerName,@{L="Variable";E={$_.Variable.'#cdata-section'}},@{L="Value";E={$_.Value.'#cdata-section'}} | Sort PSComputerName,Variable -Unique
$SysBuilds = $SysEnvVars | ? {$_.Variable -match "version"}
#$SysInfoFiles=(Get-ChildItem -Path $SDDCPath -Filter "SystemInfo.TXT" -Recurse -Depth 1).FullName
$GetComputerInfo=gci $SDDCPath -Filter "GetComputerInfo.xml" -Recurse -Depth 1 | Import-Clixml
#$SystemInfoData=@()
$SysInfo=@()
<#ForEach($dFile in $SysInfoFiles){ # Changed 06072023
$SystemInfoContent=@()
$SystemInfoContent= Get-Content $dFile
$osInfo=@{}
$SystemInfoContent | Where-Object{($_ -like "OS*") -or ($_ -like "Host Name:*") -or ($_ -like "System Model:*")} | %{try {$osInfo.add($_.split(":")[0].trim(),$_.split(":")[1].trim())} catch {}}
$SysInfo += [PSCustomObject] @{
HostName = $osInfo.'Host Name'
OSVersion = ($osInfo.'OS Version' -split "\s+")[0]
OSBuildNumber = ($osInfo.'OS Version' -split "\s+")[-1]
OSName = $osInfo.'OS Name'.Replace('Microsoft','').Trim() # remove Microsoft
SysModel = $osInfo.'System Model'
}
}#>
ForEach ($osInfo in $GetComputerInfo) {
$SysInfo += [PSCustomObject] @{
HostName = $osInfo.CsCaption
OSVersion = $osInfo.OsVersion
OSBuildNumber = $osInfo.OsBuildNumber
OSName = $osInfo.OSName.Replace('Microsoft','').Trim() # remove Microsoft
AzureLocalVersion = ''
SysModel = $osInfo.CsModel
LocalTime = $osInfo.OsLocalDateTime
}
}
if (!($GetComputerInfo)) {
$GetComputerInfo=gci $SDDCPath -Filter "Win32_OperatingSystem.xml" -Recurse -Depth 1 | Import-Clixml
ForEach ($osInfo in $GetComputerInfo) {
$SysInfo += [PSCustomObject] @{
HostName = $osInfo.CsName
OSVersion = $osInfo.Version
OSBuildNumber = $osInfo.BuildNumber
OSName = $osInfo.Caption.Replace('Microsoft','').Trim() # remove Microsoft
AzureLocalVersion = ''
SysModel = (gc -Path "$SDDCPath\Node_$($osInfo.CsName)\SystemInfo.TXT" | Select-String "System Model: ").Line.split(":")[-1].Trim()
LocalTime = $osInfo.LocalDateTime
}
}
}
# determine os version, used later on
$OSVersionNodes = 'Unknown'
# Azure Stack HCI OS versions
If($SysInfo[0].OSName -imatch 'HCI'){
# update Azure Local version in $SysInfo table, per node
$StampFiles=gci $SDDCPath -Filter "GetStampInformation.xml" -Recurse -Depth 1
ForEach ($StampFile in $StampFiles) {
$NodeName = ($StampFile.DirectoryName | split-path -Leaf).Replace('Node_','')
$GetStampInformation= $StampFile | Import-Clixml
ForEach($Sys in $SysInfo){
if ($Sys.HostName -eq $nodeName) {
$Sys.AzureLocalVersion = $GetStampInformation[0].StampVersion
}
}
}
#NOT APEX nodes
IF($SysInfo[0].SysModel -notmatch "^APEX"){
$OSVersionNodes = Switch ($SysInfo[0].OSBuildNumber) {
'19042' {'20H2'}
'20348' {'21H2'}
'20349' {'22H2'}
'25398' {'23H2'}
'26100' {'24H2'}
Default {"RREEDD"+$SysInfo[0].OSBuildNumber}
}
}
#APEX nodes
IF($SysInfo[0].SysModel -match "^APEX"){
$OSVersionNodes = Switch ($SysInfo[0].OSBuildNumber) {