I use sqlserver psdrive, then I cd to databases and issue the following
$a = Dir | ?{$_.Schema -eq "$schemaname" } | ft Name, RowCount, DataSpaceUsed, IndexSpaceUsed -Auto
Typing $a I get 4 or 5 records. checked the $a type and I get
$a.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Object[] System.Array
So It is an array.
Trying to acces 1st item using $a[0] I get nothing, doing $a[1], I get an error
> Object reference not set to an instance of an object.
> + CategoryInfo : NotSpecified: (:) [out-lineoutput], NullReferenceException
> + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.OutLineOutputCommand
What am I doing wrong? Thanks