Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Composing PowerShell "Get-Help" that is readable in my code

$
0
0

Hopefully I explain this so that you guys can get what I am trying to do. It is not so much a problem, but more of a personal preference. I would like to keep my code as easily readable as can be so that includes not having the code extend so far to the right that the reader has to scroll over to the right to read all of the text (without word-wrap). In my actual PS Code I can use the back-tick ("`") to allow me to add a line return in the code which can help keep the code narrow on the page, but it doesn't affect the code running as all one line of code itself.

I am trying to do the same thing in my Comment Based Help I include with the Functions.  If I add a return/line break in the code it also does so in the Help text when printed.  This does not allow for people to have different sized PowerShell windows an have the help text scale accordingly to use their window size.  If I write in one giant line with no line breaks in the code it scales itself and wraps accordingly.

Is there any such character or means of doing this in my help text that allows me to add line returns in my code, but have it appear as one long line that word wraps at the edges of the window size when running the Get-Help command?

If I use the back-tick it just prints the back-tick and does not keep it one line.  I'll try and show below.

<#
.SYNOPSIS

This works because it is one long line with no returns on the code itself. This function outputs the relevant information for documenting a users configuration for work orders.

.DESCRIPTION

This dos not work right as when I add returns to code it adds returns to the output also. 
This function outputs the relevant information for documenting a users ` 
configuration for work orders. It outputs Name, Employee ID, Login, Title, `
Description, AD OU, Email, Home Directory, expiration date, and group
memberships.


Find this post helpful? Does this post answer your question? Be sure to mark it appropriately to help others find answers to their searches.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>