I'm in the process of writing a PowerShell script to automatically decline certain updates in WSUS. Any Driver updates or language packs can be safely declined. For some reason, I got stuck wondering about this question.
The first is a standard If/ElseIf.
If ( $update.UpdateClassificationTitle -eq 'Drivers' )
{
$update.Decline()
}
ElseIf ( $update.UpdateTitle -match 'LanguageFeature' )
{
$update.Decline()
}
The second is if (true -or true).
If ( ( $update.UpdateClassificationTitle -eq 'Drivers' ) -or ( $update.UpdateTitle -match 'LanguageFeature' ) )
{
$update.Decline()
}
Which is more efficient? How is each evaluated? Which is better practice?