Change the way version numbers are generated
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user