How to stop Powershell truncating data?

I am struggling to get my Powershell output to print out completed.  The data is just what I want ... but it truncates with ...}.
Get-Datastore | Select Name, @{N="NumVM";E={@($_ | Get-VM)}}

Such as :  DS-34            {apmyvdisa1, apmyvs1, apmyvdimr1, apmyfusionapp1...}

Can someone help with me with how to stop this:  I've Googled and tried variations of -autosize, -wrap, out-string, etc.. - I just can't make it stop.

Thanks
apsutechteamAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jeremy WeisingerSenior Network Consultant / EngineerCommented:
So FT -wrap doesn't work for you?
Get-Datastore | Select Name, @{N="NumVM";E={@($_ | Get-VM)}} | ft -wrap

Open in new window


Can you try Format-Custom? This is going to be a ton of info:
Get-Datastore | Select Name, @{N="NumVM";E={@($_ | Get-VM)}} | FC

Open in new window

apsutechteamAuthor Commented:
Get-Datastore | Select Name, @{N="NumVM";E={@($_ | Get-VM)}} | ft -wrap

Gives me:
PowerCLI C:\> Get-Datastore | Select Name, @{N="NumVM";E={@($_ | Get-VM)}}

Name             NumVM
----             -----
DS-APBRNJ2-DATA2
DS-36            {apmyproj1, apbrarg2, apbrnetwrix2, apbrnetwrix...}
DS-ISOs          {apstudconnect, apbrvcenter, apbrnj2, apstigrhel7...}
*****************
*****************
The second suggestion gives me lots of errors - especially about deprecation --
WARNING: The 'CpuAffinity' property of VMResourceConfiguration type is deprecated. Use the 'CpuAffinityList' property
instead.
WARNING: The 'DrsMode' property of Cluster type is deprecated. Use the 'DrsAutomationLevel' property instead.
WARNING:  The 'ScsiLun' property of VMHostStorageInfo type is deprecated. Use 'Get-ScsiLun' cmdlet instead.
WARNING: The 'VMKernelGatewayDevice' property of VMHostNetworkInfo type is deprecated and will be removed in a future
release.
WARNING: The 'VirtualSwitch' property of VMHostNetworkInfo type is deprecated. Use 'Get-VirtualSwitch' cmdlet instead.
WARNING: The 'PhysicalNic' property of VMHostNetworkInfo type is deprecated. Use 'Get-VMHostNetworkAdapter' cmdlet
instead.
WARNING: The 'ConsoleNic' property of VMHostNetworkInfo type is deprecated. Use 'Get-VMHostNetworkAdapter' cmdlet
instead.
WARNING: The 'VirtualNic' property of VMHostNetworkInfo type is deprecated. Use 'Get-VMHostNetworkAdapter' cmdlet
instead.
WARNING: The value of 'ExtensionData' property of VMHostNetworkInfo type is deprecated and will be
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Is this a typo?
PowerCLI C:\> Get-Datastore | Select Name, @{N="NumVM";E={@($_ | Get-VM)}}

If not, you're missing the | ft -wrap

Assuming it's a typo and you did specify the -wrap then it must be what you're calling in the select. You could try something like this:

Get-Datastore | Select Name, @{N="NumVM";E={($_ | Get-VM | select -ExpandProperty Name) -join ", "}} | ft -wrap

Open in new window

or
Get-Datastore | Select Name, @{N="NumVM";E={($_ | Get-VM | select -ExpandProperty Name)}} | ft -wrap

Open in new window

Unfortunately I'm only guessing. I'm not familiar with the VMWare cmdlets and I don't know what type of objects get returned.

So the FC is just expanding out everything in the objects. Those are warnings and not errors. They're just informational.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

apsutechteamAuthor Commented:
This still didn't work:   PowerCLI C:\> Get-Datastore | Select Name, @{N="NumVM";E={($_ | Get-VM | select -ExpandProperty Name)}} | ft -wrap

Name             NumVM
----             -----
DS-APBRNJ2-DATA2
DS-36            {apmyproj1, apbrarg2, apbrnetwrix2, apbrnetwrix...}
DS-ISOs          {apstudconnect, apbrvcenter, apbrnj2, apstigrhel7...}
DS-25            {apmycf1, apbroc4}

However -- the one with the 'join' does work -- fabulous -- thank you .  Wow, why is this so difficult?

And yes,  the comment I'd sent back earlier was a 'bad copy' leaving off the end.
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Glad to help. :)
Ben Personick (Previously QCubed)Lead Network EngineerCommented:
Oh really?  Join works?  I wonder if that is simpler?

I found that unless you manually create the output your get wraps, I will mess with the carriage returns and lines on the script to get the desired output from FT but it's not perfect.

The only way I can really control the data is to manually put it in variables and print them myself, but then there is the issue of the spacing being terrible.

I keep thinking about creating my own version of FT that does the needful, but join seems like it may be a nice workaround.

I'll have ot play with it.
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Solution provided.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.