Skip to content

Commit

Permalink
Added message about whether something was uninstalled or not
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilio0404 committed Sep 27, 2023
1 parent b689309 commit c4f3c27
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Binary file added install/0
Binary file not shown.
13 changes: 10 additions & 3 deletions install/uninstall.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# Enable a default -Verbose flag for debug output.
[CmdletBinding()]
Param([switch] $NoUpdatePath)

# Halt script execution at the first failed command.
$script:ErrorActionPreference='Stop'

$deleted = $false

function Uninstall {
$uninstallDirectory = Get-UninstallDirectory
Remove-InstallationFolder $uninstallDirectory
Remove-FromPath $uninstallDirectory
Write-Output "Uninstalled AzureAuth!"

if ($deleted) {
Write-Output "Uninstalled AzureAuth!"
} else {
Write-Output "There were no AzureAuth installations to be deleted."
}
}

function Get-UninstallDirectory {
Expand All @@ -25,6 +31,7 @@ function Remove-InstallationFolder {
if (Test-Path -Path $directory) {
Write-Verbose "Removing installations at '${directory}'"
Remove-Item -Force -Recurse $directory
$script:deleted = $true
} else {
Write-Verbose "There were no installations found at '${directory}'"
}
Expand All @@ -44,7 +51,7 @@ function Remove-FromPath {
if (!$az.Contains($uninstallDirectory)) {
$additionalDirectory = (Get-Item $az).Directory.FullName
Write-Verbose "Additional installation found in ${additionalDirectory}"
$index = $otherDirectories.Add($additionalDirectory)
$_ = $otherDirectories.Add($additionalDirectory)
Remove-InstallationFolder ($additionalDirectory)
}
}
Expand Down

0 comments on commit c4f3c27

Please sign in to comment.