Public/Get-CalvinAndHobbes.ps1
function Get-CalvinAndHobbes { 0..-14 | ForEach-Object { $Date = (Get-Date).AddDays($_) $Url = 'https://www.gocomics.com/calvinandhobbes/{0:d4}/{1:d2}/{2:d2}' -f $Date.Year, $Date.Month, $Date.Day $ImageSrc = Invoke-WebRequest -Uri $Url | Select-Object -ExpandProperty Images | Select-Object -ExpandProperty src | Where-Object { $_ -match '^https://assets.amuniversal.com/[\w*]' } [PSCustomObject]@{ PSTypeName = 'UncommonSense.CalvinAndHobbes.Article' Title = 'Calvin & Hobbes' Date = $Date Url = $Url Body = $ImageSrc } } } |