FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PowerShell/AddRemovePrograms.ps1 at master · Isaurio07/PowerShell · GitHub
Isaurio07
/
PowerShell
Public
forked from
MicksITBlogs/PowerShell
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
PowerShell
/
AddRemovePrograms.ps1
Copy path
More file actions
More file actions
Latest commit
History
History
History
88 lines (85 loc) · 3.36 KB
Breadcrumbs
PowerShell
/
AddRemovePrograms.ps1
Copy path
File metadata and controls
88 lines (85 loc) · 3.36 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#******************************************************************************
*
#
Author: Mick Pletcher
#
Date: 12 June 2013
#
#
Program: Add/Remove Programs
#
Description: This script will either list all applications in the Add/Remove
#
programs, which is pulled from both the registry. On a 64-bit
#
machine, it pulls from both the x86 and x64 add/remove programs
#
registry entries. You will also have the option to search for
#
a specific application.
#
*******************************************************************************
cls
$
Global
:OS
Function
GetOSArchitecture
{
$
Global
:OS
=
Get-WMIObject
win32_operatingsystem
#
$Global:OS.OSArchitecture
#
Answers: 32-bit, 64-bit
}
$DisplayOutput
=
$false
GetOSArchitecture
[
System.Reflection.Assembly
]::LoadWithPartialName(
"
System.Windows.Forms
"
)
[
System.Reflection.Assembly
]::LoadWithPartialName(
'
Microsoft.VisualBasic
'
)
|
Out-Null
$Output
=
[
System.Windows.Forms.MessageBox
]::Show(
"
Search for a specific program?
"
,
"
Status
"
,
4
)
If
(
$Output
-eq
"
Yes
"
){
$ProgramName
=
[
Microsoft.VisualBasic.Interaction
]::InputBox(
"
Enter specific software name:
"
)
$ProgramName
=
"
*
"
+
$ProgramName
+
"
*
"
}
If
(
$
Global
:OS
.OSArchitecture
-eq
"
32-bit
"
){
$RegPath
=
"
HKLM:\software\microsoft\windows\currentversion\uninstall\
"
$Results
=
Get-ChildItem
$RegPath
-
Recurse
-
ErrorAction SilentlyContinue
foreach
(
$item
in
$Resultsx86
){
If
((
$item
.GetValue
(
"
DisplayName
"
)
-ne
$null
)
-and
(
$item
.GetValue
(
"
UninstallString
"
)
-ne
$null
)) {
Write-Host
Write-Host
Write-Host
"
Software:
"
$item
.GetValue
(
"
DisplayName
"
)
Write-Host
"
Version:
"
$item
.GetValue
(
"
DisplayVersion
"
)
Write-Host
"
Uninstaller:
"
$item
.GetValue
(
"
UninstallString
"
)
}
}
}
If
(
$
Global
:OS
.OSArchitecture
-eq
"
64-bit
"
){
$RegPathx86
=
"
HKLM:\software\wow6432node\microsoft\windows\currentversion\uninstall\
"
$RegPathx64
=
"
HKLM:\software\microsoft\windows\currentversion\uninstall\
"
$Resultsx86
=
Get-ChildItem
$RegPathx86
-
Recurse
-
ErrorAction SilentlyContinue
$Resultsx64
=
Get-ChildItem
$RegPathx64
-
Recurse
-
ErrorAction SilentlyContinue
foreach
(
$item
in
$Resultsx86
){
If
((
$item
.GetValue
(
"
DisplayName
"
)
-ne
$null
)
-and
(
$item
.GetValue
(
"
UninstallString
"
)
-ne
$null
)) {
If
(
$Output
-eq
"
Yes
"
){
If
(
$item
.GetValue
(
"
DisplayName
"
)
-like
$ProgramName
){
$DisplayOutput
=
$true
}
}
else
{
$DisplayOutput
=
$true
}
If
(
$DisplayOutput
-eq
$true
){
Write-Host
Write-Host
Write-Host
"
Software:
"
$item
.GetValue
(
"
DisplayName
"
)
Write-Host
"
Version:
"
$item
.GetValue
(
"
DisplayVersion
"
)
Write-Host
"
Uninstaller:
"
$item
.GetValue
(
"
UninstallString
"
)
}
}
$DisplayOutput
=
$false
}
$DisplayOutput
=
$false
foreach
(
$item
in
$Resultsx64
){
If
((
$item
.GetValue
(
"
DisplayName
"
)
-ne
$null
)
-and
(
$item
.GetValue
(
"
UninstallString
"
)
-ne
$null
)) {
If
(
$Output
-eq
"
Yes
"
){
If
(
$item
.GetValue
(
"
DisplayName
"
)
-like
$ProgramName
){
$DisplayOutput
=
$true
}
}
else
{
$DisplayOutput
=
$true
}
If
(
$DisplayOutput
-eq
$true
){
Write-Host
Write-Host
Write-Host
"
Software:
"
$item
.GetValue
(
"
DisplayName
"
)
Write-Host
"
Version:
"
$item
.GetValue
(
"
DisplayVersion
"
)
Write-Host
"
Uninstaller:
"
$item
.GetValue
(
"
UninstallString
"
)
}
}
$DisplayOutput
=
$false
}
}
Back
|
FazBrowse Home
|
New Git URL