Parse ATOM rss feed and remove html tags

后端 未结 2 646
难免孤独
难免孤独 2021-01-26 15:20

am developing this code using powershell. I need to be able to extract the html tags.

  Invoke-WebRequest -Uri \'https://psu.box.com/shared/static/jf36ohodxnw7oe         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-26 16:13

    You could replace
    with actual line breaks, then tag-strip the rest completely:

    $commentsPlain = $msg.description.InnerText -replace '
    ',[System.Environment]::NewLine -replace '<[^>]+>' [PSCustomObject]@{ 'LastUpdated' = [datetime]$msg.pubDate 'Title' = $msg.title 'Category' = $msg.category 'Author' = $msg.author 'Link' = $msg.link 'UpVotes' = $Upvote 'DownVotes' = $Downvote 'Validations' = $Validation 'WorkArounds' = $Workaround 'Comments' = $commentsPlain 'FeedbackID' = $FeedBackID }

提交回复
热议问题