Job reports of PowerShell commands wrap at 80 characters per line
search cancel

Job reports of PowerShell commands wrap at 80 characters per line


Article ID: 88166


Updated On:


CA Automic Workload Automation - Automation Engine


Error Message :

A Windows JOBS is used to execute PowerShell commands using the interpreter:

<Please see attached file for image>


The PowerShell command, executed on the command line, delivers a table and the lines are not wrapped:

<Please see attached file for image>


In the example, a simple Get-Content is used to show the content of a txt-file. Executing the same command in a Windows JOBS, the results are wrapped at 80 characters as shown below.

<Please see attached file for image>


This behavior cannot be changed on Automic's side and is not a defect of our product. By default, PowerShell sessions are opened with a line length of 80 characters and everything longer is wrapped.



OS: Windows


Cause type:
By design
Root Cause: The default line length for PowerShell is 80 characters and Automic calls PowerSehll with the default settings. If these settings do not fit the needs, it has to be changed on PowerShell side.


To overcome this, a PowerShell profile-file can be created by executing the following command in a Windows JOBS on the same Agent and with the same Login-User as the JOBS with the previous PowerSehll command:
New-Item -path $profile -type file –force

The result in the job report looks like this:

<Please see attached file for image>


The command creates a profile-file that will be used from now on for this user (sup in the example), and the output shows the path and the filename of this file. Open this file in a text-editor and insert the following lines:

$rawUI = $Host.UI.RawUI
$oldSize = $rawUI.BufferSize
$typeName = $oldSize.GetType( ).FullName
$newSize = New-Object $typeName (200, $oldSize.Height)
$rawUI.BufferSize = $newSize

These script-lines set the line length of a PowerShell session for this user to 200 (marked in red above) characters. The line length can be chosen as needed. The lines will no longer wrap at 80 characters.

<Please see attached file for image>



Fix Status: No Fix

Fix Version(s):

Additional Information

Workaround :


1558693359252000088166_sktwi1f5rjvs16m68.png get_app
1558693357496000088166_sktwi1f5rjvs16m67.png get_app
1558693355667000088166_sktwi1f5rjvs16m66.png get_app
1558693353798000088166_sktwi1f5rjvs16m65.png get_app
1558693351901000088166_sktwi1f5rjvs16m64.png get_app