Files
Chronometer/BuildTasks/ImportModule.Task.ps1
Kevin Marquette dcb3f40371 Initial commit
2018-03-25 15:39:30 -07:00

20 lines
600 B
PowerShell

task ImportModule {
if (-not(Test-Path -Path $ManifestPath))
{
"Module [$ModuleName] is not built; cannot find [$ManifestPath]."
Write-Error -Message "Could not find module manifest [$ManifestPath]. You may need to build the module first."
}
else
{
if (Get-Module -Name $ModuleName)
{
"Unloading Module [$ModuleName] from a previous import..."
Remove-Module -Name $ModuleName
}
"Importing Module [$ModuleName] from [$ManifestPath]..."
Import-Module -FullyQualifiedName $ManifestPath -Force
}
}