Pwch, Powershell, Bypass, ExecutionPolicy
PowerShell 7.6.4
-----------------------------------------------------------------------------
D:\Projects\VS02\2606\FlacToMp3\Giga\FlacToMp3_02\Version2\SetExePolicy_01.ps1
--------------------------------------------------------------------------
PS D:\Projects\VS02\2606\FlacToMp3\Giga\FlacToMp3_02\Version2> .\SetExePolicy_01.ps1
Bypass
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Bypass
CurrentUser Undefined
LocalMachine RemoteSigned
--------------------------------------------------------------------
PS C:\Users\Administrator> dotnet --version
10.0.302
PS C:\Users\Administrator> $env:ASPNETCORE_ENVIRONMENT
PS C:\Users\Administrator> Test-Path ".\logs" -PathType Container
False
PS C:\Users\Administrator> Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
PS C:\Users\Administrator> Get-ExecutionPolicy
Bypass
PS C:\Users\Administrator> Get-ExecutionPolicy -List
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Bypass
CurrentUser Undefined
LocalMachine RemoteSigned
PS C:\Users\Administrator> $PSExecutionPolicyPreference
PS C:\Users\Administrator> .\test.ps1
.\test.ps1: The term '.\test.ps1' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS C:\Users\Administrator> .\test-bypass_.ps1
.\test-bypass_.ps1: The term '.\test-bypass_.ps1' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS C:\Users\Administrator> .\test_bypass_.ps1
Скрипт выполнился! ExecutionPolicy = Bypass
PS C:\Users\Administrator> $PSHOME
C:\Program Files\WindowsApps\Microsoft.PowerShell_7.6.4.0_x64__8wekyb3d8bbwe
PS C:\Users\Administrator> Test-Path "C:\Program Files\PowerShell\7\pwsh.exe"
False
PS C:\Users\Administrator> Test-Path "C:\Program Files\test_bypass_.ps1"
False
PS C:\Users\Administrator>
Комментариев нет:
Отправить комментарий