FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PowerShell/AddRemoveProgramEntries.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
334
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
/
AddRemoveProgramEntries.ps1
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (28 loc) · 1.8 KB
Breadcrumbs
PowerShell
/
AddRemoveProgramEntries.ps1
Copy path
File metadata and controls
31 lines (28 loc) · 1.8 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
AddRemovePrograms
(
$KeyName
,
$DisplayName
,
$Version
){
#
Define Local Memory
New-PSDrive
-
Name HKCR
-
PSProvider Registry
-
Root HKEY_CLASSES_ROOT
Set-Variable
-
Name AddRemKey
-
Scope Local
-
Force
Set-Variable
-
Name guid
-
Scope Local
-
Force
Set-Variable
-
Name ProductsKey
-
Scope Local
-
Force
If
(
!
(
Test-Path
c:\windows\GSPBox_Icon.bmp)){
Copy-Item
-
Path \\global.
gsp\data\clients\na_clients\Build\Add-ins
\GSPBox_Icon.bmp
-
Destination c:\Windows
-
Force
}
$AddRemKey
=
"
HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
"
$ProductsKey
=
"
HKCR:\Installer\Products\
"
New-Item
-
Path
$AddRemKey
-
Name
$KeyName
–Force
New-ItemProperty
-
Path
$AddRemKey
"
\
"
$KeyName
-
Name DisplayName
-
Value
$DisplayName
-
PropertyType String
New-ItemProperty
-
Path
$AddRemKey
"
\
"
$KeyName
-
Name DisplayVersion
-
Value
$Version
-
PropertyType String
New-ItemProperty
-
Path
$AddRemKey
"
\
"
$KeyName
-
Name UninstallString
-
Value
"
"
-
PropertyType String
New-ItemProperty
-
Path
$AddRemKey
"
\
"
$KeyName
-
Name Publisher
-
Value
"
Gresham, Smith and Partners
"
-
PropertyType String
New-ItemProperty
-
Path
$AddRemKey
"
\
"
$KeyName
-
Name DisplayIcon
-
Value
"
c:\windows\GSPBox_Icon.bmp
"
-
PropertyType String
$guid
=
[
guid
]::NewGuid().ToString(
"
N
"
)
$guid
.ToString
()
$guid
=
$guid
.ToUpper
()
New-Item
-
Path
$ProductsKey
-
Name
$guid
–Force
New-ItemProperty
-
Path
$ProductsKey
"
\
"
$guid
-
Name ProductName
-
Value
$DisplayName
-
PropertyType String
-
Force
#
Cleanup Local Memory
remove-psdrive
-
name HKCR
Remove-Variable
-
Name AddRemKey
-
Scope Local
-
Force
Remove-Variable
-
Name guid
-
Scope Local
-
Force
Remove-Variable
-
Name ProductsKey
-
Scope Local
-
Force
}
Back
|
FazBrowse Home
|
New Git URL