Update deploy.ps1

This commit is contained in:
Ben Claussen 2023-02-24 11:46:06 -05:00
parent 5b7f0c658b
commit 44dc6c86a2

View file

@ -155,7 +155,12 @@ Copy-Item -Path $ConcatenatedFilePath -Destination $PSM1OutputPath -Force
Write-Host "Deployment complete" -ForegroundColor Green
if ($ResetCurrentEnvironment) {
Write-Warning "Running commands to reset current environment"
if (Get-Module 'NetboxPS') {
Remove-Module NetboxPS -Force
}
Write-Host " Reimporting module"
Import-Module $PSM1OutputPath, $PSD1OutputPath -Force -ErrorAction Stop
Write-Host "Reset complete" -ForegroundColor Green
}