tools/chocolateyUninstall.ps1

# This is a template for creating the chocolateyUninstall.ps1 for powershell modules
$ErrorActionPreference = 'Stop';
$packageName  = 'FogApi';

function Remove-ModuleManually {
    param ([string]$modName)
    $psModules = "C:\Program Files\WindowsPowerShell\Modules";
    Write-Verbose "Removing module if loaded"
    if ($null -ne (Get-Module $modName)) {
        Write-Verbose "Module is loaded, removing"
        Remove-Module $modName -Force -EA 0; #Remove the module from the shell environment
    }

    Write-Verbose "Force uninstalling module"
    Uninstall-Module $modName -Force -EA 0;

    Write-Verbose "Checking if module folder still exists in $psModules"
    $modPath = (Get-ChildItem $psModules -Directory -Filter $modName); # Get where the module is installed
    if ($null -ne $modPath) {
        Write-Verbose "Folder exists, removing folder";
        Remove-Item $modPath -Force -Recurse -EA 0; #Remove the folder and file from the psmodule path
    }
    return;
}

Remove-ModuleManually $packageName;
return;

# SIG # Begin signature block
# MIIQpgYJKoZIhvcNAQcCoIIQlzCCEJMCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUnQX43KXTmLE8+KwrsMbYvIk9
# xsKggg0NMIIFiTCCA3GgAwIBAgIQN1osf+GqS6BH6tcXABgA1DANBgkqhkiG9w0B
# AQsFADBLMRMwEQYKCZImiZPyLGQBGRYDY29tMR8wHQYKCZImiZPyLGQBGRYPYXJy
# b3doZWFkZGVudGFsMRMwEQYDVQQDEwpBcnJvd1NlY0NhMB4XDTE3MDIwNzIxNTg1
# MFoXDTIyMDIwNzIyMDg0MlowSzETMBEGCgmSJomT8ixkARkWA2NvbTEfMB0GCgmS
# JomT8ixkARkWD2Fycm93aGVhZGRlbnRhbDETMBEGA1UEAxMKQXJyb3dTZWNDYTCC
# AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMhkMlfIR+4RxhLYnlPRHxIp
# NDa2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