troubleshooting Question

Variable / String Appends in Powershell

Avatar of campbell1972
campbell1972 asked on
Powershell
3 Comments2 Solutions134 ViewsLast Modified:
I'm in the process of building a PowerShell script which is making heavy use of ConvertTo-HTML to serve as the basis for a web-based reporting tool.

However, I've hit a brick wall with regard to how variables may be appended.

The script sometimes breaks out into a loop when multiple databases need to be interrogated. For  the first database, the HTML is built for the result set as a variable with the last script action being "ConvertTo-HTML  xxxxxx | Output-String".

For the second and subsequent databases, I simply want to append the output to the existing variable.

Any pointers greatly appreciated!
ASKER CERTIFIED SOLUTION
Chris Dent
PowerShell Developer
Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros