From 7c3cfd7152011d483324643af5e4508e45ac8814 Mon Sep 17 00:00:00 2001 From: Travis Drake Date: Mon, 27 Aug 2018 17:58:55 -0700 Subject: [PATCH] More setVersion fixes --- BuildTasks/SetVersion.Task.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/BuildTasks/SetVersion.Task.ps1 b/BuildTasks/SetVersion.Task.ps1 index 4078213..dcfe45c 100644 --- a/BuildTasks/SetVersion.Task.ps1 +++ b/BuildTasks/SetVersion.Task.ps1 @@ -48,7 +48,7 @@ task SetVersion { } "Checking for published version" - $publishedModule = Find-Module -Name $ModuleName -ErrorAction 'SilentlyContinue' | + $publishedModule = Find-Module -Name $ModuleName -ErrorAction 'Ignore' | Sort-Object -Property {[version]$_.Version} -Descending | Select -First 1 @@ -64,7 +64,10 @@ task SetVersion { [System.Collections.Generic.HashSet[string]] $publishedInterface = GetModulePublicInterfaceMap -Path (Join-Path $downloadFolder $ModuleName) [System.Collections.Generic.HashSet[string]] $buildInterface = GetModulePublicInterfaceMap -Path $ManifestPath - + if ($null -eq $publishedInterface) + { + $publishedInterface = [System.Collections.Generic.HashSet[string]]::new() + } if( -not $publishedInterface.IsSubsetOf($buildInterface)) {