Refactor: Remove redundant Success property assignment

Removes the logic that adds a `Success` property to the returned object when an existing driver package is found.

This property is handled by the calling function, making this assignment unnecessary and simplifying the driver-saving task functions.
This commit is contained in:
rbalsleyMSFT
2025-06-28 00:57:38 -07:00
parent 1523091637
commit d6689888b2
4 changed files with 0 additions and 20 deletions
@@ -208,11 +208,6 @@ function Save-DellDriversTask {
if ($null -ne $ProgressQueue) { Invoke-ProgressUpdate -ProgressQueue $ProgressQueue -Identifier $modelName -Status $existingDriver.Status }
}
# Ensure the Success property exists on the object being returned.
if (-not $existingDriver.PSObject.Properties.Name -contains 'Success') {
$existingDriver | Add-Member -MemberType NoteProperty -Name 'Success' -Value $true
}
return $existingDriver
}
@@ -152,11 +152,6 @@ function Save-HPDriversTask {
if ($null -ne $ProgressQueue) { Invoke-ProgressUpdate -ProgressQueue $ProgressQueue -Identifier $identifier -Status $existingDriver.Status }
}
# Ensure the Success property exists on the object being returned.
if (-not $existingDriver.PSObject.Properties.Name -contains 'Success') {
$existingDriver | Add-Member -MemberType NoteProperty -Name 'Success' -Value $true
}
return $existingDriver
}
@@ -126,11 +126,6 @@ function Save-LenovoDriversTask {
if ($null -ne $ProgressQueue) { Invoke-ProgressUpdate -ProgressQueue $ProgressQueue -Identifier $identifier -Status $existingDriver.Status }
}
# Ensure the Success property exists on the object being returned.
if (-not $existingDriver.PSObject.Properties.Name -contains 'Success') {
$existingDriver | Add-Member -MemberType NoteProperty -Name 'Success' -Value $true
}
return $existingDriver
}
@@ -132,11 +132,6 @@ function Save-MicrosoftDriversTask {
if ($null -ne $ProgressQueue) { Invoke-ProgressUpdate -ProgressQueue $ProgressQueue -Identifier $modelName -Status $existingDriver.Status }
}
# Ensure the Success property exists on the object being returned.
if (-not $existingDriver.PSObject.Properties.Name -contains 'Success') {
$existingDriver | Add-Member -MemberType NoteProperty -Name 'Success' -Value $true
}
return $existingDriver
}