-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathget-pp.ps1
111 lines (105 loc) · 2.87 KB
/
get-pp.ps1
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<#
.Synopsis
Installs or removes pookiepack
.DESCRIPTION
An attempt is made to automatically whitelist appropriate directories for you!
.EXAMPLE
.\get-pp.ps1 -install
Installs Pookiepack
.EXAMPLE
.\get-pp.ps1 -remove
Removes Pookiepack
#>
[CmdletBinding()]
Param
(
[switch]$remove,
[switch]$install #,
#[switch]$all,
#[switch]$easy,
#[switch]$browser
)
$wd = $SCRIPT:MyInvocation.MyCommand.path | Split-Path -Parent
Import-Module $wd\pp-mod.psm1
function check-pp($install,$remove){
$PPstate = (get-ItemProperty -Path HKLM:\SOFTWARE\SRPBAK\software -ErrorAction SilentlyContinue).PPState
if($install -and ($PPstate -eq 1)){
Write-Host -ForegroundColor Red "IT LOOKS LIKE POOKIEPACK IS ALREADY INSTALLED, ARE YOU SURE YOU WANT TO INSTALL AGAIN?"
Write-Host -ForegroundColor Red "YOU SHOULD CONSIDER REMOVING POOKIEPACK FIRST WITH .\GET-PP -REMOVE"
$resp = Read-Host -Prompt "ARE YOU SURE? (Y/N)"
if ($resp -match "Y"){
write-host "okie we doing it!"
}
elseif($resp -match "N"){
write-host "great! try uninstalling first"
exit
}
else{
Write-Error "invalid answer, exiting..."
exit
}
}
elseif($remove -and ($PPstate -eq 0)){
Write-Host -ForegroundColor Red "IT LOOKS LIKE POOKIEPACK ISNT INSTALLED, ARE YOU SURE YOU WANT TO REMOVE?"
Write-Host -ForegroundColor Red "YOU SHOULD CONSIDER REMOVING POOKIEPACK FIRST WITH .\GET-PP -REMOVE"
$resp = Read-Host -Prompt "ARE YOU SURE? (Y/N)"
if ($resp -match "Y"){
write-host "okie we doing it!"
}
elseif($resp -match "N"){
write-host "great! try installing first"
exit
}
else{
Write-Error "invalid answer, exiting..."
exit
}
}
}
function install(){
new-restore
set-wpad
set-wdigest
set-netbios
#set-compbrows
set-llmnr
set-font
set-network
set-odns
set-log
set-ftype
set-emet -command install
set-teloff
& $wd\srp.ps1 set
Set-ItemProperty -Path HKLM:\SOFTWARE\SRPBAK\software -Name "PPState" -Value "1" -Force
Write-Host "Great, you should now have pookiepack installed!"
}
function uninstall(){
& $wd\srp.ps1 unset
clear-wpad
clear-wdigest
#clear-netbios
#clear-compbrows
clear-llmnr
clear-font
set-emet -command uninstall
clear-log
clear-network
clear-odns
set-telon
Set-ItemProperty -Path HKLM:\SOFTWARE\SRPBAK\software -Name "PPState" -Value "0" -Force
Write-Host ""
Write-Host ""
Write-Host "You should now have pookiepack removed! I'm sorry if you don't like it but it is in its infancy"
}
if($install){
check-pp -install 1
install
}
elseif($remove){
check-pp -remove 1
uninstall
}
else {
#write-host "need switches dummy! e.g. -install or -remove"
}