Skip to content

Commit

Permalink
y
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmiiz committed Dec 14, 2023
1 parent b95fc9b commit 8387c1b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/linuxinfo/public/Get-ComputerInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function Get-ComputerInfo {


$script:CPUData = lscpu | awk '/^Model name:/ || /^Socket\(s\):/ || /^Core\(s\) per socket:/ || /^Thread\(s\) per core:/ {print $0}' | Sort-Object

$script:OSData = (Get-Content /etc/os-release) | Select-String -Pattern '(?<=NAME=|VERSION=|PRETTY_NAME=|HOME_URL=|SUPPORT_END=)[^,\n]+' -Raw

# DisplayData
Expand Down Expand Up @@ -143,11 +144,11 @@ function Get-ComputerInfo {
$BiosVersion = Get-Content "/sys/class/dmi/id/bios_version"
}

if ($CPUData[0].Replace(" ", "").Split(":")[1] -like " *") {
$CPUData = $CPUData[0].Replace(" ", "").Split(":")[1].TrimStart(" ")
if ($CPUData[1].Replace(" ", "").Split(":")[1] -like " *") {
$CPUData = $CPUData[1].Replace(" ", "").Split(":")[1].TrimStart(" ")
}
else {
$CPUData = $CPUData[0].Replace(" ", "").Split(":")[1]
$CPUData = $CPUData[1].Replace(" ", "").Split(":")[1]
}

$Return = [PSCustomObject][ordered]@{
Expand Down

0 comments on commit 8387c1b

Please sign in to comment.