PowerCli 5.1 Expand With Of Results Column

I found a Powershell script online that list the provisioned and allocated state of our datastores. The scripts works great but some of my datastore names are very long and the script truncates the name. How can I stop this for happening
LVL 21
Who is Participating?

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

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.

HDatabase AdministratorCommented:
I just noticed you want to expand the width of the column instead of substring-ing it...   Apologizes.   If you can send the script it would make it much easier.

There are multiple ways to expand the column depending on the script..


| Format-Table -Property * -AutoSize `
| Out-String -Width 4096 `
| Out-File C:\datastores.txt


You can modify the darasore variable to a larger value, or set it to -1 for “unlimited”.

$DataStoreName =-1

Auto-size parameter

Format-Table -Wrap -AutoSize


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
compdigit44Author Commented:
here is the script that I found online. I would be nice if this could automatically export with out having to use the > when running the script as a ps1 file...

get-datastore | select-object name,@{Label=”FreespaceGB”;E={“{0:n2}” -f ($_.FreespaceGB)}}, CapacityGB, @{Label=”Provisioned”;E={“{0:n2}” -f ($_.CapacityGB – $_.FreespaceGB +($_.extensiondata.summary.uncommitted/1GB))}}|sort name

Open in new window

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

From novice to tech pro — start learning today.