The Copy HTML feature does not detect all carriage returns

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 7 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
jmilczek
Posts: 7
Last visit: Tue Sep 05, 2017 7:29 am

The Copy HTML feature does not detect all carriage returns

Post by jmilczek »

Product, version and build: PowerShell Studio 2016, 5.2.122
32 or 64 bit version of product: 64
Operating system: Windows 10
32 or 64 bit OS: 64
PowerShell Version: 5

The Copy HTML feature does not detect all carriage returns.
Code: [Select all] [Expand/Collapse] [Download] (Untitled.html)
  1. <pre><span style="color: #8B0000;">$CWlist</span><span style="color: #000000;"> </span><span style="color: #00008B;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF; font-weight: bold;">import-csv</span><span style="color: #000000;"> </span><span style="color: #5A0032;">c:\Powershell\BOWS\CW_Users_without_laptops.csv</span><span style="color: #000000;">
  2. </span><span style="color: #8B0000;">$ACSlist</span><span style="color: #000000;"> </span><span style="color: #00008B;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF; font-weight: bold;">Import-Csv</span><span style="color: #000000;"> </span><span style="color: #5A0032;">c:\Powershell\BOWS\report-consolidated.csv</span><span style="color: #000000;">
  3.  
  4. </span><span style="color: #8B0000;">$matches</span><span style="color: #000000;"> </span><span style="color: #00008B;">=</span><span style="color: #000000;"> @()
  5. </span><span style="color: #0000FF;">foreach</span><span style="color: #000000;"> (</span><span style="color: #8B0000;">$ACS</span><span style="color: #000000;"> </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> </span><span style="color: #8B0000;">$ACSlist</span><span style="color: #000000;">) {
  6.     </span><span style="color: #0000FF;">If</span><span style="color: #000000;"> (</span><span style="color: #8B0000;">$ACS</span><span style="color: #000000;">.Username </span><span style="color: #00008B;">-like</span><span style="color: #000000;"> </span><span style="color: #FF0000;">"*@*"</span><span style="color: #000000;">) {
  7.         </span><span style="color: #0000FF;">foreach</span><span style="color: #000000;"> (</span><span style="color: #8B0000;">$CW</span><span style="color: #000000;"> </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> </span><span style="color: #8B0000;">$CWlist</span><span style="color: #000000;">) {
  8.             </span><span style="color: #0000FF;">If</span><span style="color: #000000;"> (</span><span style="color: #8B0000;">$CW</span><span style="color: #000000;">.</span><span style="color: #FF0000;">"Email"</span><span style="color: #000000;"> </span><span style="color: #00008B;">-notlike</span><span style="color: #000000;"> </span><span style="color: #FF0000;">""</span><span style="color: #000000;">) {
  9.                 </span><span style="color: #0000FF;">If</span><span style="color: #000000;"> (</span><span style="color: #8B0000;">$ACS</span><span style="color: #000000;">.UserName </span><span style="color: #00008B;">-like</span><span style="color: #000000;"> </span><span style="color: #FF0000;">"</span><span style="color: #8B0000;">$</span><span style="color: #000000;">(</span><span style="color: #8B0000;">$CW</span><span style="color: #000000;">.</span><span style="color: #FF0000;">'Email'</span><span style="color: #000000;">)</span><span style="color: #FF0000;">"</span><span style="color: #000000;">) {
  10.                     </span><span style="color: #00008B;">[</span><span style="color: #0F5186;">Management.Automation.PSObject</span><span style="color: #00008B;">]</span><span style="color: #8B0000;">$object</span><span style="color: #000000;"> </span><span style="color: #00008B;">=</span><span style="color: #000000;"> </span><span style="color: #8B0000;">$CW</span><span style="color: #000000;">
  11.                     </span><span style="color: #0000FF; font-weight: bold;">Add-Member</span><span style="color: #000000;"> </span><span style="color: #3399FF;">-InputObject</span><span style="color: #000000;"> </span><span style="color: #8B0000;">$object</span><span style="color: #000000;"> </span><span style="color: #3399FF;">-NotePropertyName</span><span style="color: #000000;"> </span><span style="color: #5A0032;">NASIPAddress</span><span style="color: #000000;"> </span><span style="color: #3399FF;">-NotePropertyValue</span><span style="color: #000000;"> </span><span style="color: #8B0000;">$ACS</span><span style="color: #000000;">.</span><span style="color: #FF0000;">"NAS-IP-Address"</span><span style="color: #000000;">
  12.                     </span><span style="color: #8B0000;">$matches</span><span style="color: #000000;"> </span><span style="color: #00008B;">+=</span><span style="color: #000000;"> </span><span style="color: #8B0000;">$object</span><span style="color: #000000;">
  13.                 }
  14.             }
  15.         }
  16.     }
  17.     </span><span style="color: #0000FF;">Else</span><span style="color: #000000;"> {
  18.         </span><span style="color: #0000FF;">If</span><span style="color: #000000;"> (</span><span style="color: #8B0000;">$ACS</span><span style="color: #000000;">.Username </span><span style="color: #00008B;">-like</span><span style="color: #000000;"> </span><span style="color: #FF0000;">"*\*"</span><span style="color: #000000;">) {
  19.             </span><span style="color: #8B0000;">$ACSsplit</span><span style="color: #000000;"> </span><span style="color: #00008B;">=</span><span style="color: #000000;"> (</span><span style="color: #8B0000;">$ACS</span><span style="color: #000000;">.Username).split(</span><span style="color: #FF0000;">"\\"</span><span style="color: #000000;">)
  20.             </span><span style="color: #8B0000;">$ACSuid</span><span style="color: #000000;"> </span><span style="color: #00008B;">=</span><span style="color: #000000;"> </span><span style="color: #8B0000;">$ACSsplit</span><span style="color: #00008B;">[</span><span style="color: #8B0000;">$ACSsplit</span><span style="color: #000000;">.count </span><span style="color: #00008B;">-</span><span style="color: #000000;"> </span><span style="color: #4B0082;">1</span><span style="color: #00008B;">]</span><span style="color: #000000;">
  21.         }
  22.         </span><span style="color: #0000FF;">Else</span><span style="color: #000000;"> {
  23.             </span><span style="color: #8B0000;">$ACSuid</span><span style="color: #000000;"> </span><span style="color: #00008B;">=</span><span style="color: #000000;"> </span><span style="color: #8B0000;">$ACS</span><span style="color: #000000;">.Username
  24.         }
  25.         </span><span style="color: #0000FF;">foreach</span><span style="color: #000000;"> (</span><span style="color: #8B0000;">$CW</span><span style="color: #000000;"> </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> </span><span style="color: #8B0000;">$CWlist</span><span style="color: #000000;">) {
  26.             </span><span style="color: #0000FF;">If</span><span style="color: #000000;"> (</span><span style="color: #8B0000;">$CW</span><span style="color: #000000;">.</span><span style="color: #FF0000;">"User ID"</span><span style="color: #000000;"> </span><span style="color: #00008B;">-notlike</span><span style="color: #000000;"> </span><span style="color: #FF0000;">""</span><span style="color: #000000;">) {
  27.                 </span><span style="color: #0000FF;">If</span><span style="color: #000000;"> (</span><span style="color: #8B0000;">$ACSuid</span><span style="color: #000000;"> </span><span style="color: #00008B;">-like</span><span style="color: #000000;"> </span><span style="color: #FF0000;">"</span><span style="color: #8B0000;">$</span><span style="color: #000000;">(</span><span style="color: #8B0000;">$CW</span><span style="color: #000000;">.</span><span style="color: #FF0000;">'User ID'</span><span style="color: #000000;">)</span><span style="color: #FF0000;">"</span><span style="color: #000000;">) {
  28.                     </span><span style="color: #00008B;">[</span><span style="color: #0F5186;">Management.Automation.PSObject</span><span style="color: #00008B;">]</span><span style="color: #8B0000;">$object</span><span style="color: #000000;"> </span><span style="color: #00008B;">=</span><span style="color: #000000;"> </span><span style="color: #8B0000;">$CW</span><span style="color: #000000;">
  29.                     </span><span style="color: #0000FF; font-weight: bold;">Add-Member</span><span style="color: #000000;"> </span><span style="color: #3399FF;">-InputObject</span><span style="color: #000000;"> </span><span style="color: #8B0000;">$object</span><span style="color: #000000;"> </span><span style="color: #3399FF;">-NotePropertyName</span><span style="color: #000000;"> </span><span style="color: #5A0032;">NASIPAddress</span><span style="color: #000000;"> </span><span style="color: #3399FF;">-NotePropertyValue</span><span style="color: #000000;"> </span><span style="color: #8B0000;">$ACS</span><span style="color: #000000;">.</span><span style="color: #FF0000;">"NAS-IP-Address"</span><span style="color: #000000;">
  30.                     </span><span style="color: #8B0000;">$matches</span><span style="color: #000000;"> </span><span style="color: #00008B;">+=</span><span style="color: #000000;"> </span><span style="color: #8B0000;">$object</span><span style="color: #000000;">
  31.                 }
  32.             }
  33.         }
  34.     }
  35. }
  36. </span></pre>
Attachments
Find-MatchingACSCW.ps1
(1.03 KiB) Downloaded 137 times
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: The Copy HTML feature does not detect all carriage returns

Post by DevinL »

I downloaded your script, did a copy HTML and compared them and it looks correct on my end. Could you point out where it's not detecting the carriage return?
Copy_HTML.png
Copy_HTML.png (147.55 KiB) Viewed 4779 times
DevinL
SAPIEN Technologies, Inc.
User avatar
jmilczek
Posts: 7
Last visit: Tue Sep 05, 2017 7:29 am

Re: The Copy HTML feature does not detect all carriage returns

Post by jmilczek »

Highlight everything and choose "Copy HTML". The pasted HTML code places the first two lines in a single line in the resulting web page.
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: The Copy HTML feature does not detect all carriage returns

Post by DevinL »

I'm still unable to reproduce this as I did exactly that and it displayed properly.

Here's a quick clip of what I'm doing, if I'm doing anything different please point it out so that I can get this fixed for you:

http://screencast.com/t/J5vPOnzFoB7
DevinL
SAPIEN Technologies, Inc.
User avatar
jmilczek
Posts: 7
Last visit: Tue Sep 05, 2017 7:29 am

Re: The Copy HTML feature does not detect all carriage returns

Post by jmilczek »

I figured it out. My app expects a "<br />" at the end of a line to represent a new line. Is this a setting I can enable in PowerShell Studio?
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: The Copy HTML feature does not detect all carriage returns

Post by DevinL »

As far as I know there isn't an option for this but I will pass this along to the developers and double check.
DevinL
SAPIEN Technologies, Inc.
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: The Copy HTML feature does not detect all carriage returns

Post by DevinL »

I just received confirmation that there currently isn't an option to do this.

If you would like, create a topic in the Wishlist and Feature Requests forum and the developers will see it and put it on their list.
DevinL
SAPIEN Technologies, Inc.
User avatar
jmilczek
Posts: 7
Last visit: Tue Sep 05, 2017 7:29 am

Re: The Copy HTML feature does not detect all carriage returns

Post by jmilczek »

Thank you, I will give it a shot.
This topic is 7 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.