Skip to content

Commit

Permalink
(GH-442) add conditional to prevent removal of unloaded modules
Browse files Browse the repository at this point in the history
this is part of a cleaning up content that might be contained
within stderr.
  • Loading branch information
rismoney authored and ferventcoder committed Oct 2, 2015
1 parent 59dba8c commit 62dab72
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nuget/chocolatey/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ $modules = Get-ChildItem $toolsPath -Filter *.psm1
$modules | ForEach-Object {
$psm1File = $_.FullName;
$moduleName = $([System.IO.Path]::GetFileNameWithoutExtension($psm1File))
remove-module $moduleName -ErrorAction SilentlyContinue;
if (Get-Module $moduleName) {
remove-module $moduleName -ErrorAction SilentlyContinue;
}
import-module -name $psm1File;
}

Expand Down

0 comments on commit 62dab72

Please sign in to comment.