@@ -7,7 +7,7 @@ If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
7
7
Exit
8
8
}
9
9
10
- $logsFolder = " $ENV: LOCALAPPDATA \debloat-logs\"
10
+ $logsFolder = " $ENV: LOCALAPPDATA \debloat-logs\"
11
11
$logMessage = " The log folder doesn't exist. This folder will be used for storing logs created after the script runs. Creating now."
12
12
If (Test-Path $logsFolder ) {
13
13
Write-Output " $logsFolder exists. Skipping."
@@ -752,7 +752,12 @@ function LightMode {
752
752
753
753
Function RemoveApps {
754
754
755
- $RemoveAppList = (Get-Content - Path .\RemoveAppsList.json | ConvertFrom-Json ).RemoveAppList
755
+ if (Test-Path - Path .\RemoveAppsList.json - PathType Leaf) {
756
+ $RemoveAppList = (Get-Content - Path .\RemoveAppsList.json | ConvertFrom-Json ).RemoveAppList
757
+ } else {
758
+ Invoke-WebRequest - Uri https:// puvvadi.me/ RemoveAppsList - OutFile $logsFolder \RemoveAppsList.json
759
+ $RemoveAppList = (Get-Content - Path $logsFolder \RemoveAppsList.json | ConvertFrom-Json ).RemoveAppList
760
+ }
756
761
757
762
foreach ($RemoveApp in $RemoveAppList ) {
758
763
Write-Host - NoNewline " Trying to remove $ ( $RemoveApp.Id ) "
@@ -866,7 +871,13 @@ function InstallApps {
866
871
}
867
872
winget - v
868
873
if ($? ) {
869
- $AppList = (Get-Content - Path .\installapps.json | ConvertFrom-Json ).Packages
874
+
875
+ if (Test-Path - Path .\installapps.json - PathType Leaf) {
876
+ $AppList = (Get-Content - Path .\installapps.json | ConvertFrom-Json ).Packages
877
+ } else {
878
+ Invoke-WebRequest - Uri https:// puvvadi.me/ installapps - OutFile $logsFolder \installapps.json
879
+ $AppList = (Get-Content - Path $logsFolder \installapps.json | ConvertFrom-Json ).Packages
880
+ }
870
881
foreach ($app in $AppList ) {
871
882
$AppPrompt = [Windows.MessageBox ]::Show(" Install $ ( $app.Name ) with Scope $ ( $app.Scope ) " , $ ($app.Name ), $Button , $Warn )
872
883
Switch ($AppPrompt ) {
0 commit comments