Insert SCSM Carriage Return with Orchestrator

Author by Nathan Lasnoski

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

  1. Office 2013 Professional
  2. Office 2013 Project Professional
  3. TeamViewer

Have a great day! Service Desk"   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: Windows PowerShell Copyright (C) 2012 Microsoft Corporation. All rights reserved.   PS C:Usersnlasnoski> $Test = "Test 1" + "`n" + "Test 2" PS C:Usersnlasnoski> $Test Test 1 Test 2 PS C:Usersnlasnoski>   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.   Happy automating!   Nathan Lasnoski  

Author

Nathan Lasnoski

Chief Technology Officer