From 0c1037cd8c5233df2b500aca1c0a744717b81820 Mon Sep 17 00:00:00 2001 From: Jason Coleman Date: Mon, 9 Oct 2017 07:33:22 -0700 Subject: [PATCH] Fix Config Generation --- Vester/Public/New-VesterConfig.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Vester/Public/New-VesterConfig.ps1 b/Vester/Public/New-VesterConfig.ps1 index fccbc7d..4ef2dd9 100644 --- a/Vester/Public/New-VesterConfig.ps1 +++ b/Vester/Public/New-VesterConfig.ps1 @@ -211,8 +211,8 @@ function New-VesterConfig { } # TODO: Should probably offload this to a private function - $CfgLine = (Select-String -Path $Vest.Full -Pattern '\$cfg') -replace '.*\:[0-9]+\:','' - $CfgLine -match '.*\$cfg\.([a-z]+)\.([a-z]+)$' | Out-Null + $cfgLine = (get-content $Vest.Full | where {$_.trim() -match '^\$Desired = \$cfg'}) -replace '.*\:[0-9]+\:','' + $CfgLine -match '.*\$cfg\.([a-z]+)\.([a-z]+)$' | Out-Null # Run the $Actual script block, storing the result in $Result If ($Object -and ($Result = & $Actual) -ne $null) {