The NetApp Community is moving to a new platform and is in Read-Only mode. Click to learn more.
Stay connected during the transition - Join our Discord community today.

Microsoft Virtualization Discussions

foreach

JSHACHER11
4,989 Views

why is this isn't working:

$volumes = Get-Content c:\vol_list.txt

foreach ($vol in $volumes) Get-NaVolAutosize $vol | select name,isenabled | ft

cheers

1 ACCEPTED SOLUTION

vinith
4,989 Views

I gues you missed the curly braces ?

$volumes = Get-Content c:\vol_list.txt

foreach ($vol in $volumes)

{

  Get-NaVolAutosize $vol | select @{l='VolumeName';e={$vol}},isenabled | ft

}

View solution in original post

3 REPLIES 3

vinith
4,990 Views

I gues you missed the curly braces ?

$volumes = Get-Content c:\vol_list.txt

foreach ($vol in $volumes)

{

  Get-NaVolAutosize $vol | select @{l='VolumeName';e={$vol}},isenabled | ft

}

JSHACHER11
4,989 Views

I guess you missed the curly braces ?

I guess I have..

cheers

JGPSHNTAP
4,989 Views

Joel - i'll dig around for something I wrote that will inventory all this in excel... and it will tell you the min and max

Public