I was working on a project where we wanted to take several lines of text, insert carriage returns to format the text properly, and use Orchestrator to place that text into a Service Manager Service Request note. I figured that people would much rather look at a paragraph rather than one numbered line of text. In this case we wanted to insert applications which were installed on a workstation through a self-service request.
Here is what we wanted to return:
“Your request has been completed! The following applications have been installed
- Office 2013 Professional
- Office 2013 Project Professional
Have a great day!
This is far more elegant than…
“Your request has been completed! The following applications have been installed. 1. Office 2013 Professional 2. Office 2013 Project Professional 3. TeamViewer Have a great day! Service Desk”
How we did it…
We were struggling with inserting carriage returns through the stream. What we determined was we needed to use the value “`n”, which inserted the carriage return where we wanted it.
Here is a sample PowerShell run of this:
Copyright (C) 2012 Microsoft Corporation. All rights reserved.
PS C:Usersnlasnoski> $Test = “Test 1″ + “`n” + “Test 2″
PS C:Usersnlasnoski> $Test
The given functionality ended up being very simple. PowerShell to create the text and then Update SR to update the SR content with the given original text. This can be combined with output like “flattening” in Orchestrator to aggregate multiple concurrent outputs.