Change the way version numbers are generated

This commit is contained in:
Kevin Marquette
2018-08-19 20:12:05 -07:00
parent c386851a06
commit de13e31542
5 changed files with 116 additions and 117 deletions

View File

@@ -1,20 +1,32 @@
funciton ImportModule
{
param(
[string]$path,
[switch]$PassThru
)
task ImportModule {
if (-not(Test-Path -Path $ManifestPath))
$file = Get-ChildItem $path
$name = $file.BaseName
if (-not(Test-Path -Path $path))
{
"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."
"Cannot find [$($path.fullname)]."
Write-Error -Message "Could not find module manifest [$($path.fullname)]"
}
else
{
$loaded = Get-Module -Name $ModuleName -All
$loaded = Get-Module -Name $name -All -ErrorAction Ignore
if ($loaded)
{
"Unloading Module [$ModuleName] from a previous import..."
"Unloading Module [$name] from a previous import..."
$loaded | Remove-Module -Force
}
"Importing Module [$ModuleName] from [$ManifestPath]..."
Import-Module -FullyQualifiedName $ManifestPath -Force
"Importing Module [$name] from [$($path.fullname)]..."
Import-Module -FullyQualifiedName $path.fullname -Force -PassThru:$PassThru
}
}
task ImportModule {
ImportModule -Path $ManifestPath
}