windows-admins / ConfigMgr

GNU General Public License v3.0
225 stars 57 forks source link

Add Dell BIOS Detection Method #92

Open Ebag333 opened 5 years ago

Ebag333 commented 5 years ago

If version is a number like 1.2.3, then prepend with [VERSION]

If version starts with A, then leave it a string

CHANGE ME

$TargetBIOSVersion = [VERSION]"1.6.4"

CHANGE ME

$BIOSVersion = (Get-WmiObject -Query "select SMBIOSBIOSVersion from Win32_BIOS").SMBIOSBIOSVersion

If ($BIOSVersion -like 'A*') { $BIOSVersion = $BIOSVersion -replace "A", "" } else { $BIOSVersion = [Version]BIOSVersion }

if($BIOSVersion -ge $TargetBIOSVersion) { Write-Host "Installed" }

Ebag333 commented 5 years ago
# If version is a number like 1.2.3, then prepend with [VERSION]
# If version starts with A, then leave it a string

# CHANGE ME
$TargetBIOSVersion = [VERSION]"1.6.4"
# CHANGE ME

$BIOSVersion = (Get-WmiObject -Query "select SMBIOSBIOSVersion from Win32_BIOS").SMBIOSBIOSVersion

If ($BIOSVersion -like 'A*')
{
   $BIOSVersion  = $BIOSVersion -replace "A", ""
}
else
{
   $BIOSVersion = [Version]BIOSVersion
}

if($BIOSVersion -ge $TargetBIOSVersion)
{
        Write-Host "Installed"
}
Ebag333 commented 5 years ago
# If version is a number like 1.2.3, then prepend with [VERSION]
# If version starts with A, then leave it a string

# CHANGE ME
$TargetBIOSVersion = [VERSION]"1.6.4"
# CHANGE ME

$BIOSVersion = (Get-WmiObject -Query "select SMBIOSBIOSVersion from Win32_BIOS").SMBIOSBIOSVersion

If ($BIOSVersion -like 'A*')
{
   $BIOSVersion  = [INT]($BIOSVersion -replace "A", "")
}
else
{
   $BIOSVersion = [Version]BIOSVersion
}

if($BIOSVersion -ge $TargetBIOSVersion)
{
        Write-Host "Installed"
}
Ebag333 commented 5 years ago
# If version is a number like 1.2.3, then prepend with [VERSION]
# If version starts with A, then leave it a string

# CHANGE ME
$TargetBIOSVersion = "A30"
# CHANGE ME

$BIOSVersion = (Get-WmiObject -Query "select SMBIOSBIOSVersion from Win32_BIOS").SMBIOSBIOSVersion

If ($BIOSVersion -like 'A*')
{
   $BIOSVersion  = [INT]($BIOSVersion -replace "A", "")
   $TargetBIOSVersion  = [INT]($TargetBIOSVersion -replace "A", "")
}
else
{
   $BIOSVersion = [Version]$BIOSVersion
}

Write-Host $BIOSVersion

if($BIOSVersion -ge $TargetBIOSVersion)
{
        Write-Host "Installed"
}
Ebag333 commented 5 years ago
# If version is a number like 1.2.3, then prepend with [VERSION]
# If version starts with A, then leave it a string but do NOT put the A at the start

# CHANGE ME
$TargetBIOSVersion = "30"
# CHANGE ME

$BIOSVersion = (Get-WmiObject -Query "select SMBIOSBIOSVersion from Win32_BIOS").SMBIOSBIOSVersion

If ($BIOSVersion -like 'A*')
{
   $BIOSVersion  = [INT]($BIOSVersion -replace "A", "")
}
else
{
   $BIOSVersion = [Version]$BIOSVersion
}

if($BIOSVersion -ge $TargetBIOSVersion)
{
        Write-Host "Installed"
}