Hi @Arosh Wijepala ,
there is a typo in your script ;-)
This is working here:
$approvedpatches = @('patch1', 'patch2', 'patch3', 'patch4', 'patch5')
$installedpatches = @('patch1', 'patch2', 'patch3')
$approvedpatches | ForEach-Object {
if ($installedpatches -notcontains $_) {
Write-Host "Approved but not installed [$_]"
}
}
$installedpatches | ForEach-Object {
if ($approvedpatches -notcontains $_) {
Write-Host "Not approved but installed [$_]"
}
}
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten