mirror of
https://github.com/Yamato-Security/WELA.git
synced 2026-11-02 11:18:18 +01:00
Preserve positional bindings and propagate native fixture failures
This commit is contained in:
1 parent
adaf3f9681
commit
4ab4c275a5
3 files changed
+10
-6
No files matched your search
@@ -1,4 +1,7 @@
|
||||
$ErrorActionPreference='Stop';$repo=Split-Path $PSScriptRoot -Parent;$engine=(Get-Process -Id $PID).Path;$count=0
|
||||
$parameterAst=[Management.Automation.Language.Parser]::ParseFile((Join-Path $repo 'WELA.ps1'),[ref]$null,[ref]$null).ParamBlock.Parameters
|
||||
$names=@($parameterAst|ForEach-Object {$_.Name.VariablePath.UserPath});$helpIndex=[array]::IndexOf($names,'Help')
|
||||
foreach($name in @('PowerShellLoggingAction','PowerShellLoggingControl','PowerShellLoggingModuleName')){if([array]::IndexOf($names,$name) -le $helpIndex){throw 'New logging parameters must follow existing Help to preserve legacy positional binding.'};$count++}
|
||||
$cases=@(
|
||||
@{Args=@('powershell-logging','-Help');Code=0;Pattern='Windows PowerShell 5.1'},
|
||||
@{Args=@('configure','-PowerShellLoggingAction','Configure');Code=1;Pattern='require powershell-logging'},
|
||||
|
||||
Reference in new issue
Block a user