я занимаюсь разработкой этого кода с помощью powershell. Мне нужно иметь возможность извлечь теги html.
Invoke-WebRequest -Uri 'https://psu.box.com/shared/static/jf36ohodxnw7oemghsau1t7qb0w4y708.rss' - OutFile C:\users\anr2809\Documents\alerts.txt
[xml]$Content = Get-Content C:\users\anr2809\Documents\alerts.txt -Raw
$Regex = '(?s)SE1046.*?Description := "(?<Description>.*?)"'
If ($Content -match $Regex) {
"Description is '$($Matches['Description'])'"
# do something here with $Matches['Description']
}
Else {
"No match."
}
$Feed = $Content.rss.channel
ForEach ($msg in $Feed.Item){
$ParseData = (($msg.description))
ForEach ($Datum in $ParseData){
If ($Datum -like "Title"){[int]$Upvote = ($Datum).split(' ') | Select-Object -First 1}#EndIf
If ($Datum -like "comments"){[int]$Downvote = ($Datum).split(' ') | Select-Object -First 1} #EndIf
}#EndForEach
[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' = $msg.description.InnerText
'FeedbackID' = $FeedBackID
}#EndPSCustomObject
}
Это результаты, и я хотел бы удалить теги html.
LastUpdated : 3/30/2020 9:45:52 AM
Title : Enterprise Network Planned Outage
Category :
Author :
Link : link
UpVotes :
DownVotes :
Validations :
WorkArounds :
Comments :
<p><strong>People and Locations Impacted:</strong><br />All students, faculty, and staff at all State locations<br /><br />
FeedbackID :