Skip to content

Commit

Permalink
Suppression de return
Browse files Browse the repository at this point in the history
Economie de la variable Supersededpatches
Inversion du test sur $null dans le bloc if
Simplification du bloc where, la variable superseded est un booléen (true/false)
  • Loading branch information
p0w3rsh3ll committed Nov 26, 2017
1 parent 52a3672 commit 6a89570
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions FRPSUG/2017/Get-MSIZapInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -224,21 +224,16 @@ Process {
} # end of foreach root
} # end of test-path

if ($ShowSupersededPatches)
{
if ($ShowSupersededPatches) {
# Superseded patches
$Supersededpatches = @()
foreach ($j in $prodcutssar)
{
if ($j.AllPatchesEverinstalled -ne $null)
{
$Supersededpatches += ($j.AllPatchesEverinstalled | Where-Object {$_.Superseded -eq $true})

$productssar |
ForEach-Object {
if ($null -ne $_.AllPatchesEverinstalled) {
$_.AllPatchesEverinstalled | Where-Object {$_.Superseded}
}
}
return $Supersededpatches
} else {
return $prodcutssar
$productssar
}
}
End {}
Expand Down

0 comments on commit 6a89570

Please sign in to comment.