mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Scope ExecutionPolicy tests to Process
Allow it run without admin escalation
This commit is contained in:
1 parent
fb34100328
commit
4c78fc5e7f
1 file changed
+10
-10
@@ -437,11 +437,11 @@ ZoneId=$FileType
|
|||||||
Context "Validate that 'Restricted' execution policy works on OneCore powershell" {
|
Context "Validate that 'Restricted' execution policy works on OneCore powershell" {
|
||||||
|
|
||||||
BeforeAll {
|
BeforeAll {
|
||||||
Set-ExecutionPolicy Restricted -Force | Out-Null
|
Set-ExecutionPolicy Restricted -Force -Scope Process | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
AfterAll {
|
AfterAll {
|
||||||
Set-ExecutionPolicy $originalExecutionPolicy -Force | Out-Null
|
Set-ExecutionPolicy $originalExecutionPolicy -Force -Scope Process | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
function Test-RestrictedExecutionPolicy
|
function Test-RestrictedExecutionPolicy
|
||||||
@@ -507,11 +507,11 @@ ZoneId=$FileType
|
|||||||
Context "Validate that 'Unrestricted' execution policy works on OneCore powershell" {
|
Context "Validate that 'Unrestricted' execution policy works on OneCore powershell" {
|
||||||
|
|
||||||
BeforeAll {
|
BeforeAll {
|
||||||
Set-ExecutionPolicy Unrestricted -Force | Out-Null
|
Set-ExecutionPolicy Unrestricted -Force -Scope Process | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
AfterAll {
|
AfterAll {
|
||||||
Set-ExecutionPolicy $originalExecutionPolicy -Force | Out-Null
|
Set-ExecutionPolicy $originalExecutionPolicy -Force -Scope Process | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
function Test-UnrestrictedExecutionPolicy {
|
function Test-UnrestrictedExecutionPolicy {
|
||||||
@@ -553,11 +553,11 @@ ZoneId=$FileType
|
|||||||
Context "Validate that 'ByPass' execution policy works on OneCore powershell" {
|
Context "Validate that 'ByPass' execution policy works on OneCore powershell" {
|
||||||
|
|
||||||
BeforeAll {
|
BeforeAll {
|
||||||
Set-ExecutionPolicy Bypass -Force | Out-Null
|
Set-ExecutionPolicy Bypass -Force -Scope Process | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
AfterAll {
|
AfterAll {
|
||||||
Set-ExecutionPolicy $originalExecutionPolicy -Force | Out-Null
|
Set-ExecutionPolicy $originalExecutionPolicy -Force -Scope Process | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
function Test-ByPassExecutionPolicy {
|
function Test-ByPassExecutionPolicy {
|
||||||
@@ -605,11 +605,11 @@ ZoneId=$FileType
|
|||||||
Context "'RemoteSigned' execution policy works on OneCore powershell" {
|
Context "'RemoteSigned' execution policy works on OneCore powershell" {
|
||||||
|
|
||||||
BeforeAll {
|
BeforeAll {
|
||||||
Set-ExecutionPolicy RemoteSigned -Force | Out-Null
|
Set-ExecutionPolicy RemoteSigned -Force -Scope Process | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
AfterAll {
|
AfterAll {
|
||||||
Set-ExecutionPolicy $originalExecutionPolicy -Force
|
Set-ExecutionPolicy $originalExecutionPolicy -Force -Scope Process
|
||||||
}
|
}
|
||||||
|
|
||||||
function Test-RemoteSignedExecutionPolicy {
|
function Test-RemoteSignedExecutionPolicy {
|
||||||
@@ -744,11 +744,11 @@ ZoneId=$FileType
|
|||||||
Context "Validate that 'AllSigned' execution policy works on OneCore powershell" {
|
Context "Validate that 'AllSigned' execution policy works on OneCore powershell" {
|
||||||
|
|
||||||
BeforeAll {
|
BeforeAll {
|
||||||
Set-ExecutionPolicy AllSigned -Force
|
Set-ExecutionPolicy AllSigned -Force -Scope Process
|
||||||
}
|
}
|
||||||
|
|
||||||
AfterAll {
|
AfterAll {
|
||||||
Set-ExecutionPolicy $originalExecutionPolicy -Force
|
Set-ExecutionPolicy $originalExecutionPolicy -Force -Scope Process
|
||||||
}
|
}
|
||||||
|
|
||||||
function Test-AllSignedExecutionPolicy {
|
function Test-AllSignedExecutionPolicy {
|
||||||
|
|||||||
Reference in new issue
Block a user