-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdrift.ps1
2643 lines (2452 loc) · 158 KB
/
drift.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
<#
.Synopsis
DRIFT - Driver and Firmware Tool
Script to check for the latest Firmware and Drivers
.DESCRIPTION
This tool compares RAW Teseract export with
the Dell catalog to easily show drivers and
firmware DriFt from currently available
versions on downloads.dell.com
.CREATEDBY
Jim Gandy
.UPDATES
2025/01/24:v1.76 - 1. Bug Fix: TP - Fixed MS latest updates by copying and converted it from CluChk
2024/04/03:v1.73 - 1. New Feature: TP - Added 15g S2d BIOS settings
2. New Feature: JG - Moved to GitHub
3. New Feature: JG - Added Function Invoke-RunDriFT
2022/06/27:v1.72 - 1. Bug Fix: JG - Resolved missing VMWare drivers when we have 7.0.X as .X does not matter.
2. Bug Fix: JG - Added a check if SEL does not exsist then display message SEL not found.
2022/06/26:v1.71 - 1. Bug Fix: JG - Fixed issue displaying updated driver information on Azure Stack HCI-less Windows Servers.
2022/05/01:v1.70 - 1. New Featrue: JG - Added expanded telemetry data
2022/02/25:v1.69 - 1. Bug Fix: Resolved AZHCI Catalog vs Catalog Supported OS conflict
2022/02/xx:v1.68 - 1. Bug Fix: Resolved wrong Documentation link for CPLD
2021/12/07:v1.67 - 1. Update: Updated the links to the Windows update RSS feed
2. New Feature: Removed duplacate webpage is scraps
2021/11/04:v1.66 - 1. Bug Fix: Resolved 403 errors on report upload
2021/11/02:v1.65 - 1. Bug Fix: Resolved Telemetry data
2021/10/xx:v1.64 - 1. Bug Fix: Resolved missing CPLD due to source webpage format change
2. New Feature: Added supported OS to driver filter
3. Bug Fix: Removed dumps from Switch port to Host map
2020/08/xx:v1.63 - 1. Bug Fix: Removed extraneous output for new table format
2. New Feature: Added support for Precision 7910/20
3. New Feature: Moved source code to Azure
4. New Feature: Moved telemetry to Azure Tables
5. New Feature: Added Report Data to Azure Tables
6. New Feature: Removed doanloaded and extracted files
7. New Feature: Do not show emplty reports
2020/02/xx:v1.62 - 1. Bug Fix: Removed all Alias references
2. Add Feature: Added multi file commandline process via -input comma delimited list
3. Bug Fix: Fixed missing Microsoft Update due to ATOM Feed Changes
4. New Feature: Added Azure Stack Hub support
5. New Feature: New multi node reporting view for easy node comparison
6. New Feature: Added SEL log Error/Warning for the last 30 days
2020/01/28:v1.61 - 1. Bug Fix: Resolved failing CPLD details lookup
2. Bug Fix: Removed allways use AZCHI catalog.xml
3. New Feature: Add support of new iDRAC 4.40
2020/01/08:v1.60 - 1. Bug Fix: Add XR2 = R440
2. New Feature: Added Memory Settings,Node Interleaving,Disabled
3. New Feature: Added R740XD2 to System Profile Settings,Turbo Boost,Enabled
4. New Feature: Added System Security,TPM Security,On
5. New Feature: Added Power Configuration,Redundancy Policy,Redundant
6. New Feature: Added Power Configuration,Enable Hot Spare,Enabled
7. New Feature: Added Power Configuration,Primary Power Supply Unit,PSU1
8. New Feature: Added Network Settings,Enable NIC,Enabled
9. New Feature: Added Network Settings,NIC Selection,Dedicated
10. New Feature: Added CPLD updates for S2D AX/Ready Nodes
11. New Feature: Moved Switch port to Host map to CluChk mode
See older version for previous notes
#>
Function Invoke-RunDriFT{
# logging
$DateTime=Get-Date -Format yyyyMMdd_HHmmss;Start-Transcript -NoClobber -Path "C:\programdata\Dell\DriFT\DriFT_$DateTime.log"
Write-host "Starting log: C:\programdata\Dell\DriFT\DriFT_$DateTime.log"
IF(!($args)){
#Variable Cleanup
Remove-Variable * -ErrorAction SilentlyContinue
}
[system.gc]::Collect()
$DriFTVer="DriFT_v1.76"
$DirFTV=$DriFTVer.Split("v")
$DFTV=$DirFTV[1]
#Param ($TSRIn)
#If($TSRIn.lenght -gt 0){$args=$TSRIn}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Function EndScript{
break
}
$WhatsNew=@"
1. Bug Fix: TP - Fixed MS latest updates by copying and converting it from CluChk
"@
If(!($args)){Clear-Host}
$text = @"
v$DFTV
_______
\ ___ `'. .--.
' |--.\ \ |__| _.._
| | \ ' .-,.--. .--. .' .._| .|
| | | '| .-. || | | ' .' |_
| | | || | | || | __| |__ .' |
| | ' .'| | | || ||__ __|'--. .-'
| |___.' /' | | '- | | | | | |
/_______.'/ | | |__| | | | |
\_______|/ | | | | | '.'
|_| | | | /
|_| `'-'
by: Jim Gandy
"@
Write-Host $text
If($args){
IF($args -match "cluchk"){
Write-Host "DriFT running in CluChk mode..."
Write-Host " $args"
$FileNameGuid=(($args -split '\-cluchk\s')[1] -split '-input')[0].trim()
#$FileNameGuid=$args -replace '-cluchk ',""
Write-Host "File Name Guid:" $FileNameGuid
Write-Host "Processing TRS File(s)"
$TSRInputFiles=@()
$TSRInputFiles=(($args -split '-input')[1].trim() -split ',').trim()
$TSRLoc=$TSRInputFiles
$TSRLoc
$args=""
$CluChkMode="YES"
}Else{
Write-Host "CMD Mode: Processing one TSR..."
Write-Host "TSR Input File: "$args
}
}
#Input file
Function Get-FileName($initialDirectory)
{
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog -Property @{Multiselect = $true}
$OpenFileDialog.Title = "Please Select One or More SupportAssist File(s)."
$OpenFileDialog.initialDirectory = $initialDirectory
$OpenFileDialog.filter = "ZIP (*.zip)| *.zip"
$OpenFileDialog.ShowDialog((New-Object System.Windows.Forms.Form -Property @{TopMost = $true })) | Out-Null
$OpenFileDialog.filenames
}
<#If (-not $args) {
Write-Host "DriFT running in Auto CluChk mode..."
Write-Host " $args"
$FileNameGuid=New-Guid
#$FileNameGuid=$args -replace '-cluchk ',""
Write-Host "File Name Guid:" $FileNameGuid
Write-Host "Processing TRS File(s)"
#$TSRInputFiles=@()
#$TSRInputFiles=(($args -split '-input')[1].trim() -split ',').trim()
$TSRInputFiles=Get-FileName($env:USERPROFILE)
$TSRLoc=$TSRInputFiles
$TSRLoc
$args=""
$CluChkMode="YES"
}#>
IF(!($CluChkMode)){
If(!($args)){
$Title=@()
$Title+="Welcome to DriFT (Driver and Firmware Tool)"
Write-host $Title
Write-host " "
Write-Host "What's New in"$DFTV":"
Write-Host $WhatsNew
Write-Host ""
$Run = Read-Host "Ready to run? [y/n]"
If (($run -ieq "n")-or ($run -ieq "")){
$OutputType="No"
EndScript}
};
}
#Variables
#$DellURL="https://dl.dell.com/"
$DellURL="https://downloads.dell.com/"
#Get the catalog.cab
$LocCabSize=1
$DownloadFile="$env:TEMP\Catalog.cab"
#$url = "http://dl.dell.com/catalog/Catalog.cab"
$url = "https://downloads.dell.com/catalog/Catalog.cab"
#Downloading a new Catalog.cab
# Added for proxy auth
$browser = New-Object System.Net.WebClient
$browser.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
If($LocCabSize -eq "1"){
Write-host "Downloading Catalog.cab...."
$CatLocNA="NO"
#Invoke-WebRequest -Uri $url -OutFile $DownloadFile
Try{Invoke-WebRequest -Uri $url -OutFile $DownloadFile}
Catch{
$CatLocNA="YES"
Write-Host " WARNING: Catalog Source location NOT accessible. Please provide CATALOG.CAB file."-foregroundcolor Yellow
Write-Host " Or manually download from:"$url -foregroundcolor Yellow}
Finally{
#Ask for the catalog.cab
If($CatLocNA -eq "YES"){
Function Get-CatFile($initialDirectory)
{
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog -Property @{Multiselect = $true}
$OpenFileDialog.Title = "Please Select CATALOG.CAB file..."
$OpenFileDialog.initialDirectory = $initialDirectory
$OpenFileDialog.filter = "CAB (*.cab)| *.cab"
$OpenFileDialog.ShowDialog() | Out-Null
$OpenFileDialog.filenames
}
$DownloadFile=Get-CatFile("C:")
if(!$DownloadFile){
$OutputType="No"
EndScript}
}
}
}
#Check/Create temp DIR
$ExtracLoc="$env:TEMP\DriFT"
if (!(Test-Path $ExtracLoc -PathType Container)) {New-Item -ItemType Directory -Force -Path $ExtracLoc}
#Extract the cab
Write-host "Extracting Catalog.xml from CAB...."
if (Test-Path "$ExtracLoc\Catalog.xml") {Remove-Item "$ExtracLoc\Catalog.xml"}
Function Expand-Cab ($SourceFile,$TargetFolder,$Item){
$ShellObject = New-Object -com shell.application
$zipfolder = $ShellObject.namespace($sourceFile)
$Item = $zipfolder.parsename("$Item")
$TargetFolder = $ShellObject.namespace("$TargetFolder")
$TargetFolder.copyhere($Item)
}
IF(!(Test-Path "$ExtracLoc\Catalog.xml")){Expand-Cab -SourceFile $DownloadFile -TargetFolder $ExtracLoc -Item "Catalog.xml"}
# Used to extract .gz files
Function DeGZip-File{
Param(
$infile
)
$outFile = $infile.Substring(0, $infile.LastIndexOfAny('.'))
$input = New-Object System.IO.FileStream $inFile, ([IO.FileMode]::Open), ([IO.FileAccess]::Read), ([IO.FileShare]::Read)
$output = New-Object System.IO.FileStream $outFile, ([IO.FileMode]::Create), ([IO.FileAccess]::Write), ([IO.FileShare]::None)
$gzipStream = New-Object System.IO.Compression.GzipStream $input, ([IO.Compression.CompressionMode]::Decompress)
$buffer = New-Object byte[](1024)
while($true){
$read = $gzipstream.Read($buffer, 0, 1024)
if ($read -le 0){break}
$output.Write($buffer, 0, $read)
}
$gzipStream.Close()
$output.Close()
$input.Close()
}
#import the XML
Write-host "Importing Catalog.xml...."
$CatalogXMLData = [Xml] (Get-Content "$ExtracLoc\Catalog.xml")
Write-host "Filtering Catalog.xml for latest PowerEdge Firmware and Drivers...."
$allArray=@()
$Files2Download=@()
$IsNewS2DCatalog="YES" #Do not change this to No Jim. :)
$SwPort2HostMapAll=@()
Do{
# 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 = $true)]
[array] $sasWriteToken
)
$storageAccount = "gsetools"
#$tableName = "DriftTelemetryData"
# Need write access
#$sasWriteToken = "?sv=2017-04-17&si=Update&tn=DriftTelemetryData&sig=wrOnGPi/vI3g62CZyj4CPiJHILxopLuNLaMY/nk2idA%3D"
$resource = "$tableName(PartitionKey='$PartitionKey',RowKey='$Rowkey')"
# should use $resource, not $tableNmae
$tableUri = "https://$storageAccount.table.core.windows.net/$resource$sasWriteToken"
# should be headers, because you use headers in Invoke-RestMethod
$headers = @{
Accept = 'application/json;odata=nometadata'
}
$body = $data | ConvertTo-Json
#This adds and updates the table record
$item = Invoke-RestMethod -Method PUT -Uri $tableUri -Headers $headers -Body $body -ContentType application/json
}#End function add-TableData
# Generating a unique report id to link telemetry data to report data
$DReportID=""
$DReportID=(new-guid).guid
# Get the internet connection IP address by querying a public API
$internetIp = Invoke-RestMethod -Uri "https://api.ipify.org?format=json" | Select-Object -ExpandProperty ip
# Define the API endpoint URL
$geourl = "http://ip-api.com/json/$internetIp"
# Invoke the API to determine Geolocation
$response = Invoke-RestMethod $geourl
$data = @{
Region=$env:UserDomain
DriftVersion=$DFTV
ReportID=$DReportID
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
}
add-TableData -TableName "DriftTelemetryData" -PartitionKey "DriFT" -RowKey (new-guid).guid -data $data -sasWriteToken '?sv=2017-04-17&si=Update&tn=DriftTelemetryData&sig=wrOnGPi/vI3g62CZyj4CPiJHILxopLuNLaMY/nk2idA%3D'
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$NoneSupportedDevices=@()
$OutputType="HTML"
#Support Assist Data Input
IF(-not($TSRInputFiles)){
If (-not($args)){
$OutputType=$OutputType.ToUpper()
Write-Host ""
Write-Host "Please provide Support Assist Collection file from the iDRAC."
Write-Host " Steps to export a Support Assist Collection file:"
Write-Host " 1. Logon to iDRAC."
Write-Host " 2. Click on the Maintenance tab."
Write-Host " 3. Click on the SupportAssist tab."
Write-Host " 4. Click the Start a Collection button."
Write-Host " 5. Click the Collect button."
Write-Host " 6. Once completed click OK to download."
Write-Host " 7. This is the Support Assist Collection file needed."
Write-Host ""
$TSRLoc=Get-FileName($env:USERPROFILE)
if(!$TSRLoc){
$OutputType="No"
EndScript}
}Else{
IF(-not($TSRLoc)){
$TSRLoc=$args
}
}
}
#Extraction temp location
$ExtracLoc="$env:TEMP\DriFT"
if (Test-Path $ExtracLoc -PathType Container){Remove-Item $ExtracLoc -Recurse -Force | Out-Null}
if (!(Test-Path $ExtracLoc -PathType Container)) {New-Item -ItemType Directory -Force -Path $ExtracLoc | Out-Null }
#TSR unzip files
Write-Host "Unziping TSR data files...."
function Expand-ZIPFile{
param($file, $destination)
$shell = new-object -com shell.application
$zip = $shell.NameSpace($file)
foreach($item in $zip.items())
{
#Removed ,1564 to allow for DSet password prompt
#$shell.Namespace($destination).copyhere($item,1564)
$shell.Namespace($destination).copyhere($item)
Write-Host "$($item.path) extracted"
"$($item.path)"
}
}
$TFile=@()
$InnerZIP=@()
ForEach($TFile in $TSRLoc){
$ExtFolderName=$TFile.Split('\')[-1]
$ExtFolderName=$ExtFolderName.split('.')[0]
$TSRDataFolder=$ExtracLoc+"\"+$ExtFolderName
New-Item -ItemType Directory -Force -Path $TSRDataFolder | Out-Null
Expand-ZIPFile $TFile $TSRDataFolder
$InnerZIP=get-childitem $TSRDataFolder -filter '*.zip' -Exclude '*thermal*','*dumplog*' -Recurse
If($InnerZIP.name){
#$UnZipInner=$TSRDataFolder+"\"+$InnerZIP.Name
Expand-ZIPFile $InnerZIP.fullname $TSRDataFolder
$InnerInnerZIP=get-childitem $TSRDataFolder -filter '*.zip'
IF($InnerInnerZIP.name -imatch $ServiceTag){
IF($InnerInnerZIP.name -ne $InnerZIP.name){
Expand-ZIPFile $InnerInnerZIP.fullname $TSRDataFolder
}
}
}
}
$E=@()
$DriFTFolders=@()
$DriFTFolders=Get-ChildItem $ExtracLoc | Where-Object{ $_.PSIsContainer } | sort-object name
$allArrayout=@()
$MBSelLogWarnERR=@()
Foreach($E in $DriFTFolders.PSPath){
#Support Assist Enterprise Collection from iDRAC or TSR
$SupportAssistDataType=""
If ($TSRDataInventory=Get-ChildItem -Path $E -Filter inventory -Directory -Recurse -Force | ForEach-Object{ $_.fullname }){
Write-Host "SupportAssist Collection Found..."
$SupportAssistDataType="TSR"
#Importing TSR Data
Write-host "Importing TSR data...."
$CIM_BIOSAttribute=@()
$CIM_BIOSAttribute_Instances=@()
$DCIM_View=@()
$DCIM_View_Instances=@()
$DCIM_SoftwareIdentity=@()
$DCIM_SoftwareIdentity_NAMEDINSTANCE=@()
if (Test-Path $TSRDataInventory"\sysinfo_CIM_BIOSAttribute.xml" -PathType Leaf){
$CIM_BIOSAttribute=[Xml] (Get-Content $TSRDataInventory"\sysinfo_CIM_BIOSAttribute.xml")
$CIM_BIOSAttribute_Instances=$CIM_BIOSAttribute.CIM.MESSAGE.SIMPLEREQ."VALUE.NAMEDINSTANCE".INSTANCE
}Else{
$CIM_BIOSAttribute_Instances="MISSING"
}
if (Test-Path $TSRDataInventory"\sysinfo_DCIM_View.xml" -PathType Leaf){
$DCIM_View=[Xml] (Get-Content $TSRDataInventory"\sysinfo_DCIM_View.xml")
$DCIM_View_Instances=$DCIM_View.CIM.MESSAGE.SIMPLEREQ."VALUE.NAMEDINSTANCE".INSTANCE
$DCIM_VIEM_Properties=@()
foreach ($Object in @($DCIM_View_Instances)) {
$PSObject = New-Object PSObject
foreach ($Property in @($Object.Property)) {
$PSObject | Add-Member NoteProperty $Property.Name $Property.InnerText
}
$DCIM_VIEM_Properties+=$PSObject
}
}Else{
$DCIM_View_Instances="MISSING"
}
if (Test-Path $TSRDataInventory"\sysinfo_DCIM_SoftwareIdentity.xml" -PathType Leaf){
$DCIM_SoftwareIdentity=[Xml] (Get-Content $TSRDataInventory"\sysinfo_DCIM_SoftwareIdentity.xml")
$DCIM_SoftwareIdentity_NAMEDINSTANCE=$DCIM_SoftwareIdentity.CIM.MESSAGE.SIMPLEREQ."VALUE.NAMEDINSTANCE"
$DCIM_SoftwareIdentity_Properties=@()
foreach ($Object in @($DCIM_SoftwareIdentity_NAMEDINSTANCE.INSTANCE)) {
$PSObject = New-Object PSObject
foreach ($Property in @($Object.Property)) {
$PSObject | Add-Member NoteProperty $Property.Name $Property.InnerText
}
$DCIM_SoftwareIdentity_Properties+=$PSObject
}
}Else{
$DCIM_SoftwareIdentity_NAMEDINSTANCE="MISSING"
Write-host " WARNING: SoftwareIdentity.xml missing. Please upgrade to the latest iDRAC version to see the rest of the hardware." -foregroundcolor Yellow
}
# Azure Stack Hub
# All possible PM modules
[hashtable]$AZHUBElementNames = @{}
$AZHUBElementNames.Add('3X9R5','R640')
$AZHUBElementNames.Add('R4GYM','R840')
$AZHUBElementNames.Add('MGFK5','R640')
$AZHUBElementNames.Add('V4F4H','R640')
$AZHUBElementNames.Add('V8NYX','R640')
$AZHUBElementNames.Add('50CRT','R740XD')
#$AZHUBElementNames
# PM Module from TSR
$IDModule = $DCIM_SoftwareIdentity_Properties | Where-Object{$_.ElementName -imatch 'Identity Module'} |select ElementName
$IsAZHub=""
IF($AZHUBElementNames.keys -imatch (($IDModule.ElementName -split '\(')[1] -split '\)')[0]){
$IsAZHub=$True
Write-Host " Found Azure Stack Hub: $IsAZHub"
}Else{$IsAZHub=$False}
#Installed hardware from Software Identity
Write-Host "Discovering Installed Hardware..."
$DCIM_SoftwareIdentity_NAMEDINSTANCE_INSTANCENAME_KEYBINDING_KEYVALUE_Installed = $DCIM_SoftwareIdentity_NAMEDINSTANCE|`
Where-Object{$_.INSTANCENAME.KEYBINDING.KEYVALUE."#text" -Match "DCIM:INSTALLED"}
#Converting to customer property to maker easyer to manage install hardware
$TSRSystemInfo=@()
ForEach($Prop in $DCIM_SoftwareIdentity_NAMEDINSTANCE_INSTANCENAME_KEYBINDING_KEYVALUE_Installed.INSTANCE ){
$TSRSystemInfo+=[PSCustomObject]@{
ComponentType=($Prop.Property | Where-Object{$_.Name -eq 'ComponentType'} | Select-Object Value).value
ComponentID=($Prop.Property | Where-Object{$_.Name -eq 'ComponentID'} | Select-Object Value).value
VendorID=($Prop.Property | Where-Object{$_.Name -eq 'VendorID'} | Select-Object Value).value
DeviceID=($Prop.Property | Where-Object{$_.Name -eq 'DeviceID'} | Select-Object Value).value
SubDeviceID=($Prop.Property | Where-Object{$_.Name -eq 'SubDeviceID'} | Select-Object Value).value
SubVendorID=($Prop.Property | Where-Object{$_.Name -eq 'SubVendorID'} | Select-Object Value).value
Version=($Prop.Property | Where-Object{$_.Name -eq 'VersionString'} | Select-Object Value).value
Display=($Prop.Property | Where-Object{$_.Name -eq 'FQDD'} | Select-Object Value).value
ElementName=($Prop.PROPERTY | Where-Object{$_.Name -eq 'ElementName'}|Select-Object Value).Value
}
}
#Filtering for only unique hardware
Write-Host "Removing Duplicate Discovered Hardware..."
$InstalledHardwareUnique=$TSRSystemInfo|Group-Object 'ComponentID','VendorID','DeviceID','SubDeviceID','SubVendorID'|`
ForEach-Object{$_.Group|Select-Object 'componentType','componentID','vendorID','deviceID','subDeviceID','subVendorID','version','display','ElementName' -First 1}|`
Where-Object{($_.DeviceID.length -ge 1)-or($_.ComponentID.length -ge 1)}|`
sort-object 'componentType','componentID','vendorID','deviceID','subDeviceID','subVendorID','version','display'
#$InstalledHardwareUnique|FT
}
#Support Assist Enterprise Collection XML
IF($SupportAssistDataType -lt 3){
If($SAEDataInventory=Get-ChildItem -Path $DriFTFolders.fullname -Include "MaserInfo.xml","Inventory.xml" -File -Recurse -Force | Select-Object -last 1 | ForEach-Object{ $_.Directory } ){
$InvPath=""
$MasPath=""
$SupportAssistDataType="SAEX"
# Server Type and Service Tag
$chasinfoxml=Get-ChildItem -Path $DriFTFolders.fullname -Include "chasinfo.xml" -File -Recurse -Force | sort-object Length | Select-Object -last 1 | ForEach-Object{ $_.Directory }
$SvrInfo=[Xml](Get-Content $chasinfoxml"\chasinfo.xml")
#Firmware inventory
$InvPath=$SAEDataInventory.FullName+"\Inventory.xml"
IF([System.IO.File]::Exists($InvPath)){$inv=[Xml](Get-Content $InvPath)
$XMLLIB="SVMInventory"}
#Firmware Maser
$MasPath=$SAEDataInventory.FullName+"\MaserInfo.xml"
IF([System.IO.File]::Exists($MasPath)){
$inv=[Xml](Get-Content $MasPath)
$XMLLIB="OMA"}
$SystemID=$inv.$XMLLIB.System
$SystemFW=$inv.$XMLLIB.Device | Select-Object `
@{Label="componentType";Expression={$_.Application.componentType}},@{Label="componentID";Expression={$_.componentID}},`
@{Label="vendorID";Expression={$_.vendorID}},@{Label="deviceID";Expression={$_.deviceID}},`
@{Label="subDeviceID";Expression={$_.subDeviceID}},@{Label="subVendorID";Expression={$_.subVendorID}},`
@{Label="version";Expression={$_.Application.version}},@{Label="display";Expression={$_.display}},`
@{Label="application";Expression={$_.application.display}}
#Filter for unique hardware
$InstalledHardwareUnique=$SystemFW|Group-Object 'componentID','vendorID','deviceID','subDeviceID','subVendorID','version'|`
ForEach-Object{$_.Group|Select-Object 'componentType','componentID','vendorID','deviceID','subDeviceID','subVendorID','version','display','ElementName' -First 1}|`
Where-Object{($_.DeviceID.length -ge 1)-or($_.ComponentID.length -ge 1)}|`
sort-object 'componentType','componentID','vendorID','deviceID','subDeviceID','subVendorID','version','display'
}
}
#Support Assist Enterprise Collection JSON
IF($SupportAssistDataType -lt 3){
If($SAEDataInventory=Get-ChildItem -Path $DriFTFolders.fullname -Filter 'supportassist_output.json' | ForEach-Object{ $_.fullname } ){
$SupportAssistDataType="SAEJ"
#Support Assist Enterprise Collection JSON in the RAW
IF($SAEJraw=(Get-Content -raw -path $SAEDataInventory | ConvertFrom-Json)){
Write-Host "SupportAssist Collection JSON Loaded..."
Write-Host " ERROR: Invalid input file detected. Exiting." -foregroundcolor Red
}
$OutputType="No"
EndScript
}
}
IF ($SupportAssistDataType.Length -lt 3){
Write-Host
Write-Host " ERROR: Invalid input file detected. Exiting." -foregroundcolor Red
Write-Host
$OutputType="No"
EndScript
}
#Check for Server Model number
Write-host "Finding server model in TSR data...."
$ServiceTag=@()
$ServerType=@()
If($SupportAssistDataType -eq "TSR"){
$HostName=(($CIM_BIOSAttribute_Instances|`
Where-Object{($_.CLASSNAME -match "DCIM_SystemString")}).PROPERTY|`
Where-Object{$_.VALUE -eq "HostName"}).ParentNode.'PROPERTY.ARRAY' |`
Where-Object{$_.Name -match "CurrentValue"}|`
Select-Object @{Label="CurrentValue";Expression={$_.'VALUE.ARRAY'.VALUE}}
$HostName=$HostName.CurrentValue
$ServiceTag=($DCIM_View_Instances| Where-object {($_.CLASSNAME -match "DCIM_SystemView")}).PROPERTY | Where-Object {$_.NAME -eq "ServiceTag"} | Select-Object @{Label="ServiceTag";Expression={$_.Value}} | Select-Object -First 1
$ServerType=($DCIM_View_Instances| Where-Object {($_.CLASSNAME -eq "DCIM_SystemView")}).PROPERTY | Where-Object {$_.NAME -eq "MODEL"} | Select-Object @{Label="Model";Expression={$_.Value}}| Select-Object -First 1
$SystemID=(($CIM_BIOSAttribute_Instances| Where-Object {($_.CLASSNAME -eq "DCIM_LCString")}|Where-Object{$_.PROPERTY.VALUE -eq 'SYSID'}).'PROPERTY.ARRAY' | Where-Object {$_.NAME -eq "CurrentValue"}).'VALUE.ARRAY'.VALUE
########### Change this to YES to force ASHCI-catalog.xml
$S2DCatalogNeeded="No"
$ServerType=$ServerType.Model
switch ($ServerType){
# Added for Precision rack systems
{$PSItem -match 'Precision'}{
IF($ServerType.Length -gt 4){
Write-Host " Found: Server Type Precision Rack."
$SpecialCatalogNeeded="Precision"
$ServiceTag=$ServiceTag.ServiceTag
}
}
#Added for XR2 same as R440
{$PSItem -match 'XR2'}{
IF($ServerType.Length -gt 4){
Write-Host " Found: Server Type XR2. Changing to R440."
#$ServerType=$ServerType -replace "XR2","R440"
$ServerType="R440"
$S2DCatalogNeeded="NO"
$SpecialCatalogNeeded="NO"
$ServiceTag=$ServiceTag.ServiceTag
}
}
{$PSItem -match 'AX'}{
IF($ServerType.Length -gt 4){
Write-Host " Found: Server Type of AX"
$ServerType=$ServerType -replace "AX-","R"
$S2DCatalogNeeded="YES"
$SpecialCatalogNeeded="HCI"
$ServiceTag=$ServiceTag.ServiceTag+"***"
$ServiceTagList+=$ServiceTag+"_"
}
}
{$PSItem -match 'Storage Spaces Direct'}{
IF($ServerType.Length -gt 4){
Write-Host " Found: Server Type of Storage Spaces Direct Ready Node"
$ServerType=$ServerType -replace " Storage Spaces Direct RN","" -replace " Storage Spaces Direct R",""
$S2DCatalogNeeded="YES"
$SpecialCatalogNeeded="HCI"
$ServiceTag=$ServiceTag.ServiceTag+"***"
$ServiceTagList+=$ServiceTag+"_"
}
}
#Added for vSAN Ready Nodes
{$PSItem -match 'vSAN'}{
IF($ServerType.Length -gt 4){
Write-Host " Found: vSAN Ready Node"
$IsvSAN=$True
Write-Host " ERROR: vSAN is not supported yet. Try again later." -ForegroundColor Red
EndScript
}
}
#Added for ScaleIO Ready Nodes
{$PSItem -match 'ScaleIO'}{
IF($ServerType.Length -gt 4){
Write-Host " Found: ScaleIO Ready Node"
$IsvSAN=$True
Write-Host " ERROR: ScaleIO is not supported yet. Try again later." -ForegroundColor Red
EndScript
}
}
#everything else
default{
IF($ServerType.Length -gt 4){
#Added to pull the server model out Ex. PowerEdge R740XD = R740XD
$ServerType=($ServerType -split "\W")[1]
}
#Added for XC6320 servers
If(($ServerType -like "XC*") -and ((([regex]::match($ServerType,"\d+").Groups[0].Value).Trim()).length -eq 4))`
{$ServerType=$ServerType -replace "XC","C"}
Else{
#Added for XC servers
$ServerType=$ServerType -replace "XC","R"}# -replace "xd",""}
$ServiceTag=$ServiceTag.ServiceTag
$ServiceTagList+=$ServiceTag+"_"
#Added for R320 Servers
If($ServerType -eq "R320"){$ServerType=$ServerType+'/NX400'}
}
}
#No Server Type Found
If(($ServerType.Length -lt 4)-and ($ServiceTag.length -gt 0)){
# Retrieve server type from support.dell.com with Service Tag
Write-Host " WARNING: Failed to find Server Model in TSR data..." -foregroundcolor Yellow
Write-Host " Trying to retrieving Server Model from support.dell.com with Service Tag $ServiceTag..." -foregroundcolor Yellow
$URL="http://www.dell.com/support/home/us/en/19/product-support/servicetag/$ServiceTag"
$result = Invoke-webrequest -Uri $URL -Method Get
IF($result.StatusCode -match 200){
$resultTable = @{}
# Get the title
$resultTable.title = $result.ParsedHtml.title
If ($resultTable.title -match 'OEMR'){
Write-Host " ERROR: None Supported System Detected: OEMR" -foregroundcolor Red
Write-Host " No Output will be generated..." -foregroundcolor Red
$OutputType="No"
EndScript
}
$ServerType=($resultTable.title -replace "Support for ","").split("|")[0]
IF($ServerType -match 'Storage Spaces Direct'){
IF($ServerType.Length -gt 4){
Write-Host " Found: Server Type of Storage Spaces Direct Ready Node"
$ServerType=$ServerType -replace "Storage Spaces Direct ","" -replace " Ready Node",""
$ServerType=$ServerType.Trim()
$S2DCatalogNeeded="YES"
$SpecialCatalogNeeded="HCI"
$ServiceTag=$ServiceTag.ServiceTag+"***"
$ServiceTagList+=$ServiceTag+"_"
}
}Else{$ServerType=([regex]::match($ServerType,"\D[A-Z]\d+").Groups[0].Value).Trim()}
Write-Host " Success: Server Model $ServerType found by Service Tag on support.dell.com..." -foregroundcolor Green
}Else{
Write-Host " ERROR: Service Tag not found on support.dell.com..." -foregroundcolor Red
}
}
#Service tag Not found on support.dell.com
If($ServerType.Length -lt 4){
#Added to handle missing Server Model information
Write-Host " WARNING: Server Model $ServerType not expected. The expected value should be like R740." -foregroundcolor Yellow
$MOServerType = Read-Host "Would you like to manually enter the Server Model? [y/n]"
If (($MOServerType -ieq "n")-or ($MOServerType -ieq "")){
$OutputType="No"
EndScript}
Write-Host "Please type the Server Model and press Enter. "
$ServerTypeOverride=Read-Host " Example: R740"
If (($ServerTypeOverride.Length -lt 4) -or ($ServerTypeOverride -ieq "")){
Write-Host " ERROR: Server Model you entered was not in the proper format. Please run again." -foregroundcolor Red
$OutputType="No"
EndScript}
$ServerTypeOverride1 = @{
Model=$ServerTypeOverride
}
$ServerType = New-Object PSObject -Property $ServerTypeOverride1
$ServerType = $ServerType.Model
# Enable to force R740XD ASHCI Catalog
#$ServerType="$ServerType Storage Spaces Direct RN"
$ServiceTag=$ServiceTag.ServiceTag
$ServiceTagList+=$ServiceTag+"_"
}
}
If($SupportAssistDataType -eq "SAEX"){
$ServiceTag=$SvrInfo.OMA.ChassisList.Chassis.ChassisInfo.ChassisProps2.ServiceTag
$SystemId=$inv.SVMInventory.system.systemid
$S2DCatalogNeeded="NO"
$SpecialCatalogNeeded="NO"
$ServerType=$SvrInfo.OMA.ChassisList.Chassis.ChassisInfo.ChassisProps1.ChassModel
If(($SystemId.length -lt 4)-and($ServerType.length -lt 4)){
Write-Host " ERROR: Server type is missing in TSR data. No data to output...." -foregroundcolor red
$OutputType="NO"
EndScript
}
#Added for XC servers
#$ServerType=$ServerType -replace "XC","R" #-replace "xd",""
$ServiceTagList+=$ServiceTag+"_"
switch ($ServerType){
#Added for Storage Spaces Direct servers
{$PSItem -match 'Storage Spaces Direct'}{
IF($ServerType.Length -gt 4){
Write-Host " Found: Server Type of Storage Spaces Direct Ready Node"
$ServerType=$ServerType -replace " Storage Spaces Direct RN","" -replace " Storage Spaces Direct R",""
$S2DCatalogNeeded="YES"
$SpecialCatalogNeeded="HCI"
$ServiceTag=$ServiceTag+"***"
$ServiceTagList+=$ServiceTag+"_"
}
}
#everything else
default{
IF($ServerType.Length -gt 4){
#Added to pull the server model out Ex. PowerEdge R740XD = R740XD
$ServerType=($ServerType -split "\W")[1]
}
#Added for XC6320 servers
If(($ServerType -like "XC*") -and ((([regex]::match($ServerType,"\d+").Groups[0].Value).Trim()).length -eq 4))`
{$ServerType=$ServerType -replace "XC","C"}
Else{
#Added for XC servers
$ServerType=$ServerType -replace "XC","R"}# -replace "xd",""}
$ServiceTag=$ServiceTag
$ServiceTagList+=$ServiceTag+"_"
#Added for R320 Servers
If($ServerType -eq "R320"){$ServerType=$ServerType+'/NX400'}
}
}
}
If($SupportAssistDataType -eq "SAEJ"){
$ServiceTag=($SAEJraw.objects | Where-Object{$_.objectId -match 'BIOS_Setup_1_1_SystemServiceTag'}).fields.Value
$ServerType=([regex]::match(($SAEJraw.objects | Where-Object{$_.objectId -match 'BIOS_Setup_1_1_SystemModelName'}).fields.Value,"\D[A-Z]\d\d\d").Groups[0].Value).Trim()
If($ServerType.Length -lt 4){
Write-Host " ERROR: Server type is missing in input data. No data to output...." -foregroundcolor red
$OutputType="NO"
EndScript
}
#Added for XC servers
$ServerType=$ServerType -replace "XC","R" #-replace "xd",""
$ServiceTagList+=$ServiceTag+"_"
}
Write-host " Found server model:" $ServerType
Write-host "Finding Service Tag...."
Write-host " Found Service Tag:" $ServiceTag
#Installed OS Check
Write-host "Finding which OS is installed in TSR data...."
#LWXP LW64 LLXP
$OSCheck=@()
$OSMjrVer=@()
$OSMinVer=@()
$OperatingSystemYear=""
If($SupportAssistDataType -eq "TSR"){
$OSName0=$CIM_BIOSAttribute_Instances| Where-Object {($_.CLASSNAME -match "DCIM_SystemString")} | Where-Object {$_.PROPERTY.Value -Match "OSName"}
$OSName1=$OSName0.ChildNodes | Where-Object{($_.NAME -match "CurrentValue")}
$OSCheck=$OSName1.InnerText
$DriverSupport = $False
$VMWOSVer=""
Switch($OSCheck){
{$OSCheck -imatch "Windows"}{
#$OSCheck="Windows Server 2016"
IF ($OSCHECK -match "2008"){
$OperatingSystemYear = "2008"
$OSMjrVer=6
$OSMinVer=0}
IF (($OSCHECK -match "2008") -and ($OSCHECK -match "R2")){
$OperatingSystemYear = "2008 R2"
$OSMjrVer=6
$OSMinVer=1}
IF ($OSCHECK -match "2012"){
$OperatingSystemYear = "2012"
$OSMjrVer=6
$OSMinVer=2}
IF (($OSCHECK -match "2012") -and ($OSCHECK -match "R2")){
$OperatingSystemYear = "2012 R2"
$OSMjrVer=6
$OSMinVer=3}
IF ($OSCHECK -match "2016"){
$OperatingSystemYear = "2016"
$OSMjrVer=10
$OSMinVer=0
$Build=$NULL}
IF ($OSCHECK -match "2019"){
$OperatingSystemYear = "2019"
$OSMjrVer=10
$OSMinVer=17763
$Build='17784'}
IF ($OSCHECK -imatch "20H2"){
$OperatingSystemYear = "20H2"
$OSMjrVer=10
$OSMinVer=0
$Build='17784'}
IF ($OSCHECK -imatch "21H2"){
$OperatingSystemYear = "21H2"
$OSMjrVer=10
$OSMinVer=0
$Build='20348'}
IF ($OSCHECK -imatch "22H2"){
$OperatingSystemYear = "22H2"
$OSMjrVer=10
$OSMinVer=0
$Build='20349'}
IF ($OSCHECK -imatch "23H2"){
$OperatingSystemYear = "23H2"
$OSMjrVer=10
$OSMinVer=0
$Build='25398'}
IF ($OSCHECK -match "2022"){
#$OSCHECK="2022-21H2-22H2"
$OperatingSystemYear = "2022"
$OSMjrVer=10
$OSMinVer=0
$Build='20348'}
IF ($OSCHECK -match "Windows 10"){
$OSMjrVer=10
$OSMinVer=0}
$DriverSupport = $True
$OSVersion=$Build
}
{$OSCheck -imatch "VMware"}{
# Get installed VMware Version from sysinfo_CIM_BIOSAttribute.xml
$IsVMware=$True
If($OSCheck -inotmatch "build"){
$VMWOSVersion0=$CIM_BIOSAttribute_Instances| Where-Object {($_.CLASSNAME -match "DCIM_SystemString")} | Where-Object {$_.PROPERTY.Value -Match "OSVersion"}
$VMWOSVersion1=$VMWOSVersion0.ChildNodes | Where-Object{($_.NAME -match "CurrentValue")}
$VMWOSVersionCheck=$VMWOSVersion1.InnerText | Sort-Object -Unique
}Else{$VMWOSVersionCheck=$OSCheck}
#($VMWOSVersionCheck -split " ")[0]
ForEach($V in $VMWOSVersionCheck){
If($v.length -gt 0){
$VMWOSVer=""
Switch ($V){
{$V -imatch "build"}{
#$VMWOSVer=($v -replace "VMware ","" -replace "ESXi ","" -replace " Update "," U" -replace ".0 "," " -split "Build")[0]
$VMWOSVer=($v -replace "VMware ","" -replace "ESXi ","" -replace " Update "," U" -split "Build")[0]
$VMWOSVer=$VMWOSVer.trim()
$OSVersion=""
$OSVersion=$VMWOSVer
$DriverSupport = $True
}
{$V -imatch "Patch"}{
$VMWOSVer=($v -replace "Update "," U" -replace ".0 ","" -split " Patch")[0]
$OSVersion=""
$OSVersion=$VMWOSVer
$DriverSupport = $True
}
{$V -imatch "GA"}{
$VMWOSVer=($v -replace ".0 ","" -split "GA ")[0]
$OSVersion=""
$OSVersion=$VMWOSVer
$DriverSupport = $True
}
{$V -imatch "7.0.0"}{
$VMWOSVer=($v -split ".0 ")[0]
$OSVersion=""
$OSVersion=$VMWOSVer
$DriverSupport = $True
}
Default{
$VMWOSVer=($v -split " ")[0]
$OSVersion=""
$OSVersion=$VMWOSVer
$DriverSupport = $True
}
}
}
}
}
}
#Removes any extra spaces
$VMWOSVer = $VMWOSVer -replace '\s{2}', ' '
#Added to compinsate for versions like 7.0.3 U3 where the .3 after the .0 does not matter so we remove it
IF((($VMWOSVer | Select-String -Pattern '\.' -AllMatches).Matches.Count) -gt 1){
$VMWOSVer = $VMWOSVer -replace '\.[0-9]\s', ' '
}
}
If($SupportAssistDataType -eq "SAEX"){
$SAE_OS_info=$inv.SVMInventory.OperatingSystem
$OSMjrVer=$SAE_OS_info.majorVersion
$OSMinVer=$SAE_OS_info.minorVersion
IF($SAE_OS_info.osVendor -match "Microsoft"){
IF (($OSMjrVer -eq 6)-and($OSMinVer -eq 0)){
$OSCheck="Windows Server 2008"}
IF (($OSMjrVer -eq 6)-and($OSMinVer -eq 1)){
$OSCheck="Windows Server 2008 R2"}
IF (($OSMjrVer -eq 6)-and($OSMinVer -eq 2)){
$OSCheck="Windows Server 2012"}
IF (($OSMjrVer -eq 6)-and($OSMinVer -eq 3)){
$OSCheck="Windows Server 2012 R2"}
IF (($OSMjrVer -eq 10)-and($OSMinVer -eq 0)){
$OSCheck="Windows Server 2016"}
IF (($OSMjrVer -eq 0)-and($OSMinVer -eq 0)){
$OSCheck="Windows Server 2019"}
}
}
If($SupportAssistDataType -eq "SAEJ"){
$SAEJ_OSVer=@()
$SAEJ_OSVerS=@()
$SAE_OS_info=($SAEJraw.objects | Where-Object{$_.objectId -match 'OperatingSystem'}).fields.OSName
$SAEJ_OSVer=($SAEJraw.objects | Where-Object{$_.objectId -match 'OperatingSystem'}).fields.Version.split() | sort-object
$SAEJ_OSVerS=$SAEJ_OSVer[1].Split(".")
$OSMjrVer=$SAEJ_OSVerS[0]
$OSMinVer=$SAEJ_OSVerS[1]
IF($SAE_OS_info -match "Microsoft"){
$OSCheck="Windows"}
}
$NOOSSupport="NO"
IF($IsVMware -ne $True){
$OSVer = "LW64"
IF((($OSCHECK).Length -gt 0) -and ($ServerType -match "20") -and (!($OSCHECK -match "Windows"))-and (!($SAE_OS_info.osArch -match "x64"))){$OSVer = "LWXP"}
IF ($Null -eq $OSver){
#Show firmware only
Clear-Host
Write-Host " ERROR: NON-SUPPORTED OS DETECTED: $OSCheck. No output...." -foregroundcolor red
$OutputType="NO"
EndScript
}
}
If(($OSCHECK).Length -eq 0){
$InstalledOS=" NO OS Detected in TSR Data: Assuming Windows 64bit"
$OSMjrVer=6
$OSMinVer=3
}Else{$InstalledOS=($OSCheck)}
#Added for driver check