Browse Source

updates

- swap if to switch statements
pull/23/head
Danijel-James Wynyard 4 years ago
committed by GitHub
parent
commit
c063525fd4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 51
      Win 10.ps1

51
Win 10.ps1

@ -55,47 +55,32 @@ else
# Detect the OS bitness # Detect the OS bitness
# Определить разрядность ОС # Определить разрядность ОС
if (-not ([Environment]::Is64BitOperatingSystem)) switch ([Environment]::Is64BitOperatingSystem) {
{ $false {
if ($RU) if ($RU) { Write-Warning -Message "Скрипт поддерживает только Windows 10 x64" }
{ else { Write-Warning -Message "The script supports Windows 10 x64 only" }
Write-Warning -Message "Скрипт поддерживает только Windows 10 x64"
}
else
{
Write-Warning -Message "The script supports Windows 10 x64 only"
} }
break Default {}
}
# Detect the PowerShell bitness # Detect the PowerShell bitness
# Определить разрядность PowerShell # Определить разрядность PowerShell
if (-not ([IntPtr]::Size -eq 8)) switch ([IntPtr]::Size -eq 8) {
{ $false {
if ($RU) if ($RU) { Write-Warning -Message "Скрипт поддерживает только PowerShell x64" }
{ else { Write-Warning -Message "The script supports PowerShell x64 only" }
Write-Warning -Message "Скрипт поддерживает только PowerShell x64" Default {}
}
else
{
Write-Warning -Message "The script supports PowerShell x64 only"
}
break
} }
# Detect whether the script is running via PowerShell ISE # Detect whether the script is running via PowerShell ISE
# Определить, запущен ли скрипт в PowerShell ISE # Определить, запущен ли скрипт в PowerShell ISE
if ($psISE) switch ($psISE) {
{ $true {
if ($RU) if ($RU) { Write-Warning -Message "Скрипт не может быть запущен в PowerShell ISE" }
{ else { Write-Warning -Message "The script can not be run via PowerShell ISE" }
Write-Warning -Message "Скрипт не может быть запущен в PowerShell ISE"
} }
else Default {}
{
Write-Warning -Message "The script can not be run via PowerShell ISE"
}
break
} }
#endregion Check #endregion Check
@ -2933,4 +2918,4 @@ if ($Error)
} }
} }
} | Sort-Object -Property Line | Format-Table -AutoSize -Wrap | Out-String).Trim() } | Sort-Object -Property Line | Format-Table -AutoSize -Wrap | Out-String).Trim()
} }

Loading…
Cancel
Save