mirror of
https://github.com/Flowseal/zapret-discord-youtube.git
synced 2026-03-08 07:55:21 +00:00
Disable PowerShell script profiles (#9030)
This commit is contained in:
16
service.bat
16
service.bat
@@ -37,7 +37,7 @@ if "%1"=="admin" (
|
||||
call :check_command powershell
|
||||
|
||||
echo Requesting admin rights...
|
||||
powershell -Command "Start-Process 'cmd.exe' -ArgumentList '/c \"\"%~f0\" admin\"' -Verb RunAs"
|
||||
powershell -NoProfile -Command "Start-Process 'cmd.exe' -ArgumentList '/c \"\"%~f0\" admin\"' -Verb RunAs"
|
||||
exit
|
||||
)
|
||||
|
||||
@@ -338,7 +338,7 @@ set "GITHUB_RELEASE_URL=https://github.com/Flowseal/zapret-discord-youtube/relea
|
||||
set "GITHUB_DOWNLOAD_URL=https://github.com/Flowseal/zapret-discord-youtube/releases/latest/download/zapret-discord-youtube-"
|
||||
|
||||
:: Get the latest version from GitHub
|
||||
for /f "delims=" %%A in ('powershell -command "(Invoke-WebRequest -Uri \"%GITHUB_VERSION_URL%\" -Headers @{\"Cache-Control\"=\"no-cache\"} -UseBasicParsing -TimeoutSec 5).Content.Trim()" 2^>nul') do set "GITHUB_VERSION=%%A"
|
||||
for /f "delims=" %%A in ('powershell -NoProfile -Command "(Invoke-WebRequest -Uri \"%GITHUB_VERSION_URL%\" -Headers @{\"Cache-Control\"=\"no-cache\"} -UseBasicParsing -TimeoutSec 5).Content.Trim()" 2^>nul') do set "GITHUB_VERSION=%%A"
|
||||
|
||||
:: Error handling
|
||||
if not defined GITHUB_VERSION (
|
||||
@@ -513,7 +513,7 @@ echo:
|
||||
|
||||
:: DNS
|
||||
set "dohfound=0"
|
||||
for /f "delims=" %%a in ('powershell -Command "Get-ChildItem -Recurse -Path 'HKLM:System\CurrentControlSet\Services\Dnscache\InterfaceSpecificParameters\' | Get-ItemProperty | Where-Object { $_.DohFlags -gt 0 } | Measure-Object | Select-Object -ExpandProperty Count"') do (
|
||||
for /f "delims=" %%a in ('powershell -NoProfile -Command "Get-ChildItem -Recurse -Path 'HKLM:System\CurrentControlSet\Services\Dnscache\InterfaceSpecificParameters\' | Get-ItemProperty | Where-Object { $_.DohFlags -gt 0 } | Measure-Object | Select-Object -ExpandProperty Count"') do (
|
||||
if %%a gtr 0 (
|
||||
set "dohfound=1"
|
||||
)
|
||||
@@ -810,7 +810,7 @@ echo Updating ipset-all...
|
||||
if exist "%SystemRoot%\System32\curl.exe" (
|
||||
curl -L -o "%listFile%" "%url%"
|
||||
) else (
|
||||
powershell -Command ^
|
||||
powershell -NoProfile -Command ^
|
||||
"$url = '%url%';" ^
|
||||
"$out = '%listFile%';" ^
|
||||
"$dir = Split-Path -Parent $out;" ^
|
||||
@@ -840,7 +840,7 @@ echo Checking hosts file...
|
||||
if exist "%SystemRoot%\System32\curl.exe" (
|
||||
curl -L -s -o "%tempFile%" "%hostsUrl%"
|
||||
) else (
|
||||
powershell -Command ^
|
||||
powershell -NoProfile -Command ^
|
||||
"$url = '%hostsUrl%';" ^
|
||||
"$out = '%tempFile%';" ^
|
||||
"$res = Invoke-WebRequest -Uri $url -TimeoutSec 10 -UseBasicParsing;" ^
|
||||
@@ -917,15 +917,15 @@ goto menu
|
||||
:: Utility functions
|
||||
|
||||
:PrintGreen
|
||||
powershell -Command "Write-Host \"%~1\" -ForegroundColor Green"
|
||||
powershell -NoProfile -Command "Write-Host \"%~1\" -ForegroundColor Green"
|
||||
exit /b
|
||||
|
||||
:PrintRed
|
||||
powershell -Command "Write-Host \"%~1\" -ForegroundColor Red"
|
||||
powershell -NoProfile -Command "Write-Host \"%~1\" -ForegroundColor Red"
|
||||
exit /b
|
||||
|
||||
:PrintYellow
|
||||
powershell -Command "Write-Host \"%~1\" -ForegroundColor Yellow"
|
||||
powershell -NoProfile -Command "Write-Host \"%~1\" -ForegroundColor Yellow"
|
||||
exit /b
|
||||
|
||||
:check_command
|
||||
|
||||
Reference in New Issue
Block a user