Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7179677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:11:18+00:00 2026-05-28T17:11:18+00:00

First, yes I am a noob to scripting and powershell as that will become

  • 0

First, yes I am a noob to scripting and powershell as that will become painfully obvious. In my attempts to learn, I have been working with a script from here: http://www.leeholmes.com/blog/2010/03/05/html-agility-pack-rocks-your-screen-scraping-world/

This is what I have thus far:

add-type -Path 'C:\Program Files (x86)\htmlAgilityPack\HtmlAgilityPack.dll'
$doc = New-Object HtmlAgilityPack.HtmlDocument 
$result = $doc.Load("C:\scipts\test.html") 
$texts = $doc.DocumentNode.SelectNodes("//table[@class='dataTable']/tbody/tr/td[1]/a[1]") 
$result = $texts | % {
$testText = $_
$Platform = $testtext.innertext
New-Object PsObject -Property @{ Platform = $Platform} | Select Platform 
}
$result | Sort Platform | out-string

This gives me the items I am looking for.

* The Challenge *

I am trying to get that output into a variable as a single string with each item followed by a comma. for Example Item1, Item2, Item 3 etc…

Any help or explanation would be appreciated as I have Googled myself cross-eyed and don’t necessarily stand the things I am finding.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:11:19+00:00Added an answer on May 28, 2026 at 5:11 pm

    From the powershell help (get-help about_join):

    The following diagram shows the syntax for the join operator.

    <String[]> -Join <Delimiter>
    

    To solve your problem, you need to:

    1. Create an array of strings containing the strings you want to join:

      $arrayofstrings = $result | Sort Platform | foreach-object {$_.Platform}
      
    2. Join the strings using a comma as the delimiter:

      $joinedstring = $arrayofstrings -join ", "
      

    $joinedstringwill contain Item1, Item2, Item3

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Yes, it's a noob question... I have been using Dev-C++ for all my projects
I have an AXIS2/JAX-WS web service using a code first implementation (yes I know,
First off, yes, I know that the VS Setup Projects are evil. It's what
i would like to have two msg boxes yes/no. The first one for saving
First, yes I have searched already and found this answer already: GWT JSNI -
I have developed my first COM component (yes, a newbie in the realm of
Yes i have this line in my first upload case of the switch: $file_name
First, yes I know about this question , but I'm looking for a bit
I wrote my first program almost fifty years ago (yes, coding is still a
First off, I am using Windows XP. I have multiple hard drives and it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.