-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pissy.ps1
62 lines (61 loc) · 2.41 KB
/
Pissy.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
#Prerequisites Check
#Requires -RunAsAdministrator
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Set-Location D:
#Getting all exe's installed
$installers = Get-ChildItem ".\Installers" -Filter "*.exe"
foreach ($inst in $installers)
{
Write-Host "----------------------------------------------"
Write-Host "Installing $inst "
Start-Process -FilePath $inst.FullName -Wait
}
#Getting all msi's installed
$installers = Get-ChildItem ".\Installers" -Filter "*.msi"
foreach ($inst in $installers)
{
Write-Host "----------------------------------------------"
Write-Host "Installing $inst "
Start-Process -FilePath $inst.FullName -Wait
}
#Getting windows updates
Write-Host "----------------------------------------------"
Write-Host "Installing NuGet module"
Install-PackageProvider -Name NuGet -Force -Scope CurrentUser
Write-Host "----------------------------------------------"
Write-Host "Installing Windows Updater module "
Install-Module -Name PSWindowsUpdate -Force -Scope CurrentUser
Write-Host "----------------------------------------------"
Write-Host "Getting Windows Updates"
try
{
Get-WUlist -MicrosoftUpdate
}
catch
{
Write-Host "----------------------------------------------"
Write-Host "FAILED getting Windows Updates. Trying Again"
Reset-WUComponents -Verbose
Get-WUlist -MicrosoftUpdate
}
Write-Host "----------------------------------------------"
Write-Host "Installing Windows Updates"
Install-WindowsUpdate -MicrosoftUpdate -AcceptAll
Write-Host "----------------------------------------------"
Write-Host "Unstalling NuGet module"
(Get-PackageProvider NuGet).ProviderPath | Remove-Item -force
Write-Host "----------------------------------------------"
Write-Host "Unstalling Windows Updater module"
uninstall-Module -Name PSWindowsUpdate -Force
Write-Host "----------------------------------------------"
Write-Host "----------------------------------------------"
Write-Host "Installing Win11Debloat by Raphire (https://github.com/Raphire/Win11Debloat)"
try{
& ([scriptblock]::Create((Invoke-RestMethod "https://win11debloat.raphi.re/"))) -Wait
}
catch{
& ([scriptblock]::Create((Invoke-RestMethod "https://win11debloat.raphi.re/")))
}
Write-Host "----------------------------------------------"
Write-Host "Special thanks to all the members of the Drewski Discord for no particular reason whatsoever"
Restart-Computer -ForceS