param
(
[string] $ProductName = "{ProductName}"
, [switch] $Link
)
$installationPath = "$HOME\Documents\WindowsPowerShell\Modules"
$productInstallationPath = Join-Path $installationPath $ProductName
if(Test-Path $productInstallationPath)
{
Remove-Item $productInstallationPath -Force -Recurse
}
if($Link)
{
Invoke-ElevatedScript (Join-Path (Split-Path $MyInvocation.MyCommand.Path) "Stage-Module.ps1") -ProductName $ProductName -OutputPath $productInstallationPath -Link
}
else
{
& (Join-Path (Split-Path $MyInvocation.MyCommand.Path) "Stage-Module.ps1") -ProductName $ProductName -OutputPath $productInstallationPath
}