Skip to content

Commit 2d2c63d

Browse files
committed
GetDiskInfoFromWmi: Bump version to 1.4.1; Tidy source code
1 parent 76184d8 commit 2d2c63d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/GetDiskInfoFromWmi/GetDiskInfoFromWmi.au3

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@
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
2222
CHANGELOG:
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

src/GetDiskInfoFromWmi/UsageExample.au3

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Local $aOutputDisks
77
Local $aOutputPartitions
88
_GetDiskInfoFromWmi($aOutputDisks, $aOutputPartitions, $DiskInfoWmi_TableHeader_Yes, $DiskInfoWmi_DiskType_Fixed)
9-
If @error Then MSGBOX(16, @ScriptName, "Something went wrong!")
9+
If @error Then MsgBox(16, @ScriptName, "Something went wrong!")
1010

1111
_ArrayDisplay($aOutputDisks, "Disks")
1212
_ArrayDisplay($aOutputPartitions, "Partitions")

0 commit comments

Comments
 (0)