Home > Back-end >  Powershell script writes lines of data to excel cell, but too many lines
Powershell script writes lines of data to excel cell, but too many lines

Time:06-18

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.

CodePudding user response:

You can use the function autofit.

Example:

$sheet.columns.autofit()
  • Related