I am trying to print out Microsoft update hot fix URLs and change them
$link=Get-MSHotfix|Where-Object {$_.Installedon -gt ((Get-Date).Adddays(-20000))}|Select-Object -Property KBArticle
foreach($line in $link){
[String]$line = $line -replace 'http://support.microsoft.com/?kbid=','https://support.microsoft.com/en-us/kb/'
[String]$line
}
I have problem because it prints it out like this and it is not replacing:
@{KBArticle=http://support.microsoft.com/?kbid=3045992}
@{KBArticle=http://support.microsoft.com/?kbid=3045999}
@{KBArticle=http://support.microsoft.com/?kbid=3046017}
@{KBArticle=http://support.microsoft.com/?kbid=3046359}
@{KBArticle=http://support.microsoft.com/?kbid=3046737}
If I just print it without -replace it looks ok.
I am trying to get full URL of KB Article
I am trying to create a script with will print out all hot fixes with links and names from title if possible
Thanks