Reminder, I am a Powershell infant, with little or no experience. Try not to laugh to hardy at the format and attempts of this coding.
THE ISSUE: see the image.
Multiple blank lines at the beginning of the Get-ComputerInfo
output. Using the attached image, the left positioned vertical numbering is overlayed with the output of a script that recently ran Get-ComputerInfo
; notice the empty-space at lines three and four. This space has been confirmed as coming from Get-CompterInfo
, which is generated regardless if run from a ps1 script or the cli:
Cli ā Get-computerInfo "OsName", "OSDisplayVersion", "OsVersion", "osinstalldate"
Script.ps1 -- $_info = Get-computerInfo "OsName", "OSDisplayVersion", "OsVersion", "osinstalldate"
write-output $_info
The second part of this concern, within the image lines three and four begin the initial output āfrom the script
$_info = Get-computerInfo "OsName", "OSDisplayVersion", "OsVersion", "osinstalldate"
write-output $_info
ā¦ during the same script job, as it runs on the next machine (remoting), the blank lines are gone for the duration; until the script is again initiated from the beginning; evidenced by comparing lines three and four āto- lines eleven and twelve.
The only possible resolve that I have not attempted was Format-Custom, thatās a bit much for this infant to swallow. Besides, Iām not sure what affect, if any, it would have on whatever Get-ComputerInfo
has already done.
As posted earlier, these blank lines only happen during the first run on the first machine. Please donāt fix the code, instead Iām requesting the required articles to read, that will teach āhow to get this done. I 've already tried, while reading along with the respective help file, the following: Write-Output
and Write-Host
. At this point I feel like Iām driving on a rural-road with no moon or head-lightās;
your thoughts?