added boolean conversion helper and replaced code in scripts to use it
This commit is contained in:
@@ -8,6 +8,17 @@ $DsaErrors = $null
|
||||
$null = [Management.Automation.Language.Parser]::ParseFile($DsaScriptUnderTest, [ref]$DsaTokens, [ref]$DsaErrors)
|
||||
If ($DsaErrors.Count) { Throw ($DsaErrors | Out-String) }
|
||||
|
||||
# Load only the real conversion helper, without running Tools.ps1 setup.
|
||||
$DsaToolsPath = Join-Path (Split-Path $PSScriptRoot -Parent) 'Tools.ps1'
|
||||
$DsaToolsAst = [Management.Automation.Language.Parser]::ParseFile($DsaToolsPath, [ref]$DsaTokens, [ref]$DsaErrors)
|
||||
If ($DsaErrors.Count) { Throw ($DsaErrors | Out-String) }
|
||||
$DsaBooleanDefinition = $DsaToolsAst.Find({
|
||||
param($Node)
|
||||
$Node -is [Management.Automation.Language.FunctionDefinitionAst] -and $Node.Name -eq 'ConvertTo-RmmBoolean'
|
||||
}, $true)
|
||||
If (!$DsaBooleanDefinition) { Throw 'Missing helper: ConvertTo-RmmBoolean' }
|
||||
. ([scriptblock]::Create($DsaBooleanDefinition.Extent.Text))
|
||||
|
||||
Function Assert-Dsa { param([bool]$Condition, [string]$Description) If (!$Condition) { Throw $Description } }
|
||||
Function Download-File { Throw 'DSA must use Download-FileDirectly.' }
|
||||
Function Download-FileDirectly {
|
||||
|
||||
Reference in New Issue
Block a user