FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PowerShell/Uninstall-InnoSetup.ps1 at master · MicksITBlogs/PowerShell · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
MicksITBlogs
/
PowerShell
Public
Notifications
You must be signed in to change notification settings
Fork
128
Star
335
Code
Issues
6
Pull requests
3
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
PowerShell
/
Uninstall-InnoSetup.ps1
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (27 loc) · 1.15 KB
Breadcrumbs
PowerShell
/
Uninstall-InnoSetup.ps1
Copy path
File metadata and controls
31 lines (27 loc) · 1.15 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function
Uninstall-InnoSetup
{
<#
.
SYNOPSIS
Uninstall Inno Installed Application
.
DESCRIPTION
This function uninstalls an application that was installed using the Inno installer.
.
PARAMETER
AppName
Exact name as shown in Add/Remove Programs
#>
[
CmdletBinding
()]
param
(
[
ValidateNotNullOrEmpty
()][
string
]
$AppName
)
$QuietUninstallString
=
((
Get-ChildItem
-
Path
"
REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
"
,
"
REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\
"
|
ForEach-Object
{
Get-ItemProperty
REGISTRY::
$_
}
|
Where-Object
{
$_
.DisplayName
-eq
$AppName
}).QuietUninstallString).split(
"
/
"
)
$Switches
=
"
/
"
+
$QuietUninstallString
[
1
].Trim()
Write-Host
"
Uninstall
"
$AppName
"
.....
"
-
NoNewline
$ErrCode
=
(
Start-Process
-
FilePath
$QuietUninstallString
[
0
].Trim()
-
ArgumentList
$Switches
-
Wait
-
Passthru).ExitCode
If
((
$ErrCode
-eq
0
)
-or
(
$ErrCode
-eq
3010
)) {
Write-Host
"
Success
"
-
ForegroundColor Yellow
}
elseif
(
$ErrCode
-eq
1605
) {
Write-Host
"
Not Present
"
-
ForegroundColor Green
}
else
{
Write-Host
"
Failed with Error Code:
"
$ErrCode
Exit
$ErrCode
}
}
Back
|
FazBrowse Home
|
New Git URL