88#cs
99===============================================================================================================================
1010 Title ...............: _GetDiskInfoFromWmi (GitHub: https://github.com/htcfreek/AutoIt-Scripts)
11- Version .............: 1.4
11+ Version .............: 1.4.1
1212 License .............: GNU LGPLv3
1313 AutoIt Version ......: 3.3.14.5+
1414 Language ............: English
1515 Description .........: Get disk and partition informations from WMI.
1616 Author ..............: htcfreek (Heiko) - https://github.com/htcfreek [original]
17- Modified ............:
17+ Modified ............:
1818 Required includes ...: Array.au3
1919 Dll .................:
2020===============================================================================================================================
2121
2222CHANGELOG:
23+ 2021-07-06 (v1.4.1)
24+ Fixed: Code styling
25+
2326 2021-07-05 (v1.4)
2427 Fixed: Typos in script and example.
2528
@@ -79,7 +82,7 @@ Func _GetDiskInfoFromWmi(ByRef $aDiskList, ByRef $aPartitionList, $bAddTableHead
7982
8083
8184 ; Add Array header
82- if ($bAddTableHeader = 1 ) Then
85+ If ($bAddTableHeader = 1 ) Then
8386 $sDiskHeader = " DiskNum" & " ||" & " DiskDeviceID" & " ||" & " DiskManufacturer" & " ||" & " DiskModel" & " ||" & " DiskInterfaceType" & " ||" & " DiskMediaType" & " ||" & " DiskSerialNumber" & " ||" & " DiskState" & " ||" & " DiskSize" & " ||" & " DiskInitType" & " ||" & " DiskPartitionCount" & " ||" & " WindowsRunningOnDisk (SystemDrive)"
8487 _ArrayAdd($aDisks , $sDiskHeader , 0 , " ||" )
8588 $sPartitionHeader = " DiskNum" & " ||" & " PartitionNum" & " ||" & " PartitionID" & " ||" & " PartitionType" & " ||" & " PartitionIsPrimary" & " ||" & " PartitionIsBootPartition" & " ||" & " PartitionLetter" & " ||" & " PartitionLabel" & " ||" & " PartitionFileSystem" & " ||" & " PartitionSizeTotal" & " ||" & " PartitionSizeUsed" & " ||" & " PartitionSizeFree" & " ||" & " PartitionIsSystemDrive"
@@ -108,7 +111,7 @@ Func _GetDiskInfoFromWmi(ByRef $aDiskList, ByRef $aPartitionList, $bAddTableHead
108111 _ArrayAdd($aPartitions , $sNewPart , 0 , " ||" )
109112
110113 ; Set DiskInitStyle
111- if StringRegExp ($oPartition .Type, " ^GPT.*" ) Then
114+ If StringRegExp ($oPartition .Type, " ^GPT.*" ) Then
112115 $aDisks [$iDiskArrayCount ][9 ] = " GPT"
113116 Else
114117 $aDisks [$iDiskArrayCount ][9 ] = " MBR"
@@ -126,7 +129,7 @@ Func _GetDiskInfoFromWmi(ByRef $aDiskList, ByRef $aPartitionList, $bAddTableHead
126129 $aPartitions [$iPartArrayCount ][11 ] = $oLogicalDisk .FreeSpace
127130
128131 ; Detect SystemBootDisk
129- if $oLogicalDisk .DeviceID = EnvGet (" SystemDrive" ) Then
132+ If $oLogicalDisk .DeviceID = EnvGet (" SystemDrive" ) Then
130133 $aDisks [$iDiskArrayCount ][11 ] = True
131134 $aPartitions [$iPartArrayCount ][12 ] = True
132135 EndIf
0 commit comments