mirror of
https://github.com/Yamato-Security/WELA.git
synced 2026-10-09 07:45:34 +02:00
Load the service enum for isolated Windows PowerShell fixtures
This commit is contained in:
1 parent
37e93e10eb
commit
eb1b9989a1
1 file changed
+2
@@ -3,6 +3,8 @@ $repo=Split-Path $PSScriptRoot -Parent
|
||||
. "$repo/scripts/AppLockerReadiness.ps1"
|
||||
. "$repo/scripts/WefArrival.ps1"
|
||||
. "$repo/scripts/AppLockerScriptProbe.ps1"
|
||||
# Mocking Get-Service skips the cmdlet's normal .NET Framework assembly load.
|
||||
if(-not ('System.ServiceProcess.ServiceControllerStatus' -as [type])){Add-Type -AssemblyName System.ServiceProcess -ErrorAction Stop}
|
||||
$count=0
|
||||
function Assert($Value,$Message){if(-not $Value){throw $Message};$script:count++}
|
||||
function Reject([scriptblock]$Action,[string]$Pattern){$message='';try{&$Action|Out-Null}catch{$message=$_.Exception.Message};Assert ($message -match $Pattern) "Expected $Pattern; got $message"}
|
||||
|
||||
Reference in new issue
Block a user