Microsoft Virtualization Discussions

Get-nadiskowner - feature request

JGPSHNTAP
3,101 Views

Unless Im missing something, (totally possible)

can get-nadiskowner where disks are unowned, the value is null, which is true, b/c there is no owner, but can it be similiar to the cli where it states "not owned"

1 REPLY 1

JGPSHNTAP
3,101 Views

The way i've gotten around this so far was the following

$a = get-nadiskowner | group owner

$globalarray = @()

$a | % {

$custom = new-object psobject

if ($_.name -eq "") { $var = "unowned"} else { $var = $_.name}

add-member -inputobject $custom -membertype noteproperty -name "Filer" -value $var

add-member -inputobject $custom -membertype noteproperty -name "# of Drives" -value $_.count

$globalarray += $custom

}

$global | ft -autosize

Filer      # of Drives

-----      -----------

filera         76

filerb         83

unowned    24

Public