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

Loading…
Cancel
Save