Browse Source

Merge pull request #23 from danijeljw/master

Update Start.cmd with issue #22
pull/24/head
farag2 4 years ago
committed by GitHub
parent
commit
a42d733070
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Start.cmd
  2. 51
      Win 10.ps1

2
Start.cmd

@ -1,4 +1,4 @@
@echo off
chcp 65001 >nul
powershell.exe -ExecutionPolicy RemoteSigned -NoExit -NoProfile -NoLogo -File "%~dp0Win 10.ps1"
powershell.exe -ExecutionPolicy ByPass -Scope Process -NoExit -NoProfile -NoLogo -File "%~dp0Win 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