I beleive that I am experiancing a known issue with piping data to the format-table function. When I run the below script it errors out on the format table. The connect-nacontroller executes and then this error is given on the get-nacifsshare line. Does anyone have an alternative method for me to execute this and get the data formated as a table?
out-lineoutput : The object of type "Microsoft.PowerShell.Commands.Internal.Format.FormatStartData" is not valid or not in the correct sequence. This is likely caused by a user-specified "format-table" command which is conflicting with the default form
atting.
+ CategoryInfo : InvalidData: (:) [out-lineoutput], InvalidOperationException
+ FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.PowerShell.Commands.OutLineOutputCommand
$xmldata = [xml](get-content c:\scripts\data_files\netapps.xml)
$filers = $xmldata.netapps.filer | Where-Object {$_.site -match "mcr" -and $_.nstor -match "n"} | select name
foreach ($a in $filers)
{
Connect-NaController $a.NAME
Get-NaCifsShare | select $a.name, mountpoint, sharename | Format-Table
}