Powershell running function one time

Hi, I have a small script that goes and check for new rss feed every 1 minute, and the function goes to sleep for another minute. How can I make the function not to keep downloading the same title, unless there is a new topic.

$webclient = new-object System.Net.WebClient
$url=“https://something

Get the web page into a single string

$data = [xml](invoke-webrequest $url).Content
$Time = Get-Date -format g
$LastBuiltDate = ($data.rss.channel.LastBuildDate).split(‘’)[4]
$TimeDiff = New-TimeSpan -Start $LastBuiltDate -End $Time
if($TimeDiff.minutes -lt 1){
$items = ($data.rss.channel.item | select title,Description,link, @{LABEL=“Published”;EXPRESSION={[datetime]$_.pubdate}}|sort-object Published)
foreach ($msg in $items){
$titlen = $msg.title -replace ‘<br ?/?>’,[System.Environment]::NewLine -replace ‘<[^>]+>’
$Published = $msg.Published
$commentsPlain = $msg.Description.InnerText -replace ‘<br ?/?>’,[System.Environment]::NewLine -replace ‘<[^>]+>’
$weblinks = $msg.link.innertext
}

}

The RSS feed API would need to have filters that could leveraged (e.g. Date) to only return items that are newer than the last request. If there is not filter functionality, then you would have to download the results and use Compare-Object to determine what doesn’t currently exist in the stored data set.