Initializing the partitions list as an empty array
This commit is contained in:
Родитель
2d2dac0419
Коммит
e5a98a3057
|
@ -1,6 +1,6 @@
|
|||
function Get-Disk-Partitions()
|
||||
{
|
||||
$partitionlist = $null
|
||||
$partitionlist = @()
|
||||
$disklist = get-wmiobject Win32_diskdrive |Where-Object {$_.model -like 'Microsoft Virtual Disk'}
|
||||
ForEach ($disk in $disklist)
|
||||
{
|
||||
|
@ -14,4 +14,4 @@ function Get-Disk-Partitions()
|
|||
$partitionlist += Get-Partition -DiskNumber $diskID
|
||||
}
|
||||
return $partitionlist
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче