Public/Functions/split/Get-MyBiosUpdate.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
function Get-MyBiosUpdate { [CmdletBinding()] param ( [System.String]$Manufacturer = (Get-MyComputerManufacturer -Brief), [System.String]$Product = (Get-MyComputerProduct) ) #================================================= # Set ErrorActionPreference #================================================= $ErrorActionPreference = 'SilentlyContinue' #================================================= # Action #================================================= if ($Manufacturer -eq 'Dell') { $Result = Get-DellBiosCatalog | Where-Object {($_.SupportedSystemID -contains $Product)} $Result[0] } elseif ($Manufacturer -eq 'HP') { $Result = Get-HPBiosCatalog | Where-Object {($_.SupportedSystemId -contains $Product)} $Result[0] } elseif ($Manufacturer -eq 'Lenovo') { $Result = Get-LenovoBiosCatalog | Where-Object {($_.SupportedProduct -contains $Product)} $Result[0] } else { Write-Verbose "$Manufacturer is not supported yet" } #================================================= } |