From 7f51a0ca74b98399359f4e1b34efefc58ecbe3e5 Mon Sep 17 00:00:00 2001 From: Miodrag Milic Date: Sun, 21 May 2017 19:21:53 +0200 Subject: [PATCH] IgnoreOn implementation #76 --- AU/Public/Update-AUPackages.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AU/Public/Update-AUPackages.ps1 b/AU/Public/Update-AUPackages.ps1 index 61cc07b3..67b67ff0 100644 --- a/AU/Public/Update-AUPackages.ps1 +++ b/AU/Public/Update-AUPackages.ps1 @@ -188,10 +188,16 @@ function Update-AUPackages { continue main } } + foreach ($msg in $Options.IgnoreOn) { + if ($_.Exception -notlike "*${msg}*") { continue } + Write-Warning "Ignoring ${using:package_name}: $($_.Exception)" + return 'ignore' + } if ($pkg) { $pkg.Error = $_ } } } if (!$pkg) { throw "'$using:package_name' update script returned nothing" } + if (($pkg -eq 'ignore') -or ($pkg[-1] -eq 'ignore')) { return 'ignore' } $pkg = $pkg[-1]