Skip to content

Commit

Permalink
Update script.ps1
Browse files Browse the repository at this point in the history
uffemcev authored Apr 18, 2024
1 parent 31a8acd commit f09e56c
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions script.ps1
Original file line number Diff line number Diff line change
@@ -33,20 +33,15 @@ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
}

#ПРОВЕРКА ПОЛИТИК
if ($PSVersionTable.PSVersion.Major -gt 5) {
import-module -Name 'Microsoft.PowerShell.Security' -RequiredVersion 3.0.0.0
if ((get-ExecutionPolicy) -ne 'bypass') {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force}
get-ExecutionPolicy
pause
} else {
if ((get-ExecutionPolicy) -ne 'bypass') {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force}
get-ExecutionPolicy
pause
}
try {get-ExecutionPolicy | out-null}
catch {import-module -Name 'Microsoft.PowerShell.Security' -RequiredVersion 3.0.0.0}
if ((get-ExecutionPolicy) -ne 'bypass') {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force}
get-ExecutionPolicy
pause

#ПРОВЕРКА WINGET
if ((Get-AppxPackage Microsoft.DesktopAppInstaller).Version -lt [System.Version]"1.21.2771.0") {
if ((get-process | where MainWindowTitle -eq $($host.ui.RawUI.WindowTitle)) -match "Terminal") {
if ((get-process | where MainWindowTitle -eq $($host.ui.RawUI.WindowTitle)).ProcessName -match "Terminal") {
Start-Process conhost "powershell -ExecutionPolicy Bypass -Command &{cd '$pwd'; $($MyInvocation.line)}" -Verb RunAs
close
} else {

0 comments on commit f09e56c

Please sign in to comment.