简体   繁体   中英

Powershell script writes lines of data to excel cell, but too many lines

I have a powershell script that will collect data, actually file paths for anywhere from 3 - 40 different paths. I have that script populate those file paths into a single cell in an excel template. The problem is that when there a too many file paths, you cannot see them all without "double clicking" in the cell. Is there a way to create a double column in excel (using the ps script) or another way to have all those lines of data in the single cell and visible? I would post the script, but it's on another computer that is not connected to the internet.

Currently, I have each file path write to a new line within the cell for readability. And I cannot change the template.

Any help or ideas is greatly appreciated.

You can use the function autofit .

Example:

$sheet.columns.autofit()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM