mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-22 16:03:22 +01:00
Update check-cpu.ps1, check-os.ps1, and install-powershell.ps1
This commit is contained in:
parent
141a867b06
commit
17d4839150
@ -46,7 +46,17 @@ try {
|
||||
}
|
||||
|
||||
if ($IsLinux) {
|
||||
"$Status CPU has $Temp"
|
||||
$Name = $PSVersionTable.OS
|
||||
if ($Name -like "*-generic *") {
|
||||
$Arch = "x86"
|
||||
} elseif ($Name -like "*-raspi *") {
|
||||
$Arch = "ARM"
|
||||
} else {
|
||||
$Arch = ""
|
||||
}
|
||||
if ([System.Environment]::Is64BitOperatingSystem) { $Bits = "64-bit" } else { $Bits = "32-bit" }
|
||||
$Cores = [System.Environment]::ProcessorCount
|
||||
"$Status $Arch CPU $Bits ($Cores cores, $Temp)"
|
||||
} else {
|
||||
$Details = Get-WmiObject -Class Win32_Processor
|
||||
$CPUName = $Details.Name.trim()
|
||||
|
@ -13,7 +13,9 @@
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
"✅ $(uname -sr)"
|
||||
$Name = $PSVersionTable.OS
|
||||
if ([System.Environment]::Is64BitOperatingSystem) { $Bits = "64-bit" } else { $Bits = "32-bit" }
|
||||
"✅ $Name ($Bits)"
|
||||
} else {
|
||||
$OS = Get-WmiObject -class Win32_OperatingSystem
|
||||
$Name = $OS.Caption -Replace "Microsoft Windows","Windows"
|
||||
|
@ -113,7 +113,7 @@ function Expand-ArchiveInternal {
|
||||
}
|
||||
}
|
||||
|
||||
Function Remove-Destination([string] $Destination) {
|
||||
function Remove-Destination([string] $Destination) {
|
||||
if (Test-Path -Path $Destination) {
|
||||
if ($DoNotOverwrite) {
|
||||
throw "Destination folder '$Destination' already exist. Use a different path or omit '-DoNotOverwrite' to overwrite."
|
||||
@ -196,7 +196,8 @@ function Test-PathNotInSettings($Path) {
|
||||
Must be either User or Machine
|
||||
Defaults to User
|
||||
#>
|
||||
Function Add-PathTToSettings {
|
||||
|
||||
function Add-PathTToSettings {
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
|
||||
@ -246,7 +247,22 @@ Function Add-PathTToSettings {
|
||||
$Key.SetValue("PATH", $NewPathValue, $PathValueKind)
|
||||
}
|
||||
|
||||
if (-not $IsWinEnv) {
|
||||
if ($IsLinux) {
|
||||
$Name = $PSVersionTable.OS
|
||||
if ($Name -like "*-generic *") {
|
||||
if ([System.Environment]::Is64BitOperatingSystem) {
|
||||
$architecture = "x64"
|
||||
} else {
|
||||
$architecture = "x86"
|
||||
}
|
||||
} elseif ($Name -like "*-raspi *") {
|
||||
if ([System.Environment]::Is64BitOperatingSystem) {
|
||||
$architecture = "arm64"
|
||||
} else {
|
||||
$architecture = "arm32"
|
||||
}
|
||||
}
|
||||
} elseif (-not $IsWinEnv) {
|
||||
$architecture = "x64"
|
||||
} elseif ($(Get-ComputerInfo -Property OsArchitecture).OsArchitecture -eq "ARM 64-bit Processor") {
|
||||
$architecture = "arm64"
|
||||
|
Loading…
Reference in New Issue
Block a user