Add functionality to remove Edge Progressive Web Apps and update system PATH for Miniforge scripts
This commit is contained in:
@@ -178,6 +178,34 @@ foreach ($app in $officeAppsToRemove) {
|
|||||||
|
|
||||||
Write-Host "Office application removal process completed." -ForegroundColor Green
|
Write-Host "Office application removal process completed." -ForegroundColor Green
|
||||||
|
|
||||||
|
# Remove Edge Progressive Web Apps (PWAs) like LinkedIn
|
||||||
|
Write-Host "Checking and removing Edge Progressive Web Apps..." -ForegroundColor Yellow
|
||||||
|
|
||||||
|
$edgePWAPath = "$env:LOCALAPPDATA\Microsoft\Edge\User Data\Default\Web Applications"
|
||||||
|
if (Test-Path $edgePWAPath) {
|
||||||
|
try {
|
||||||
|
$pwaFolders = Get-ChildItem -Path $edgePWAPath -Directory -ErrorAction SilentlyContinue
|
||||||
|
foreach ($folder in $pwaFolders) {
|
||||||
|
$manifestPath = Join-Path $folder.FullName "Manifest"
|
||||||
|
if (Test-Path $manifestPath) {
|
||||||
|
$manifestContent = Get-Content $manifestPath -Raw -ErrorAction SilentlyContinue
|
||||||
|
if ($manifestContent -match "linkedin" -or $manifestContent -match "LinkedIn") {
|
||||||
|
Write-Host "Found LinkedIn PWA, removing folder: $($folder.Name)" -ForegroundColor Red
|
||||||
|
Remove-Item -Path $folder.FullName -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Write-Host "Removed LinkedIn PWA" -ForegroundColor Green
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
Write-Warning "Failed to check Edge PWAs: $_"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Write-Host "Edge PWA directory not found" -ForegroundColor Gray
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Edge PWA removal process completed." -ForegroundColor Green
|
||||||
|
|
||||||
# Font Install
|
# Font Install
|
||||||
Write-Host "Checking and installing fonts..." -ForegroundColor Yellow
|
Write-Host "Checking and installing fonts..." -ForegroundColor Yellow
|
||||||
$fontSourceFolder = ".\Fonts"
|
$fontSourceFolder = ".\Fonts"
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ Copy-Item -Path $sourceFile -Destination $destinationFile -Force
|
|||||||
Write-Host "policies.json has been copied/replaced in the distribution folder."
|
Write-Host "policies.json has been copied/replaced in the distribution folder."
|
||||||
|
|
||||||
$forgePath = "C:\ProgramData\miniforge3"
|
$forgePath = "C:\ProgramData\miniforge3"
|
||||||
|
$forgeScriptsPath = "C:\ProgramData\miniforge3\Scripts"
|
||||||
$systemPathReference = [System.Environment]::GetEnvironmentVariable("Path", "Machine")
|
$systemPathReference = [System.Environment]::GetEnvironmentVariable("Path", "Machine")
|
||||||
|
|
||||||
# Check if the path already contains $forgePath
|
# Check if the path already contains $forgePath
|
||||||
@@ -57,6 +58,15 @@ if (-not ($systemPathReference -split ";" | Where-Object { $_ -eq $forgePath }))
|
|||||||
[System.Environment]::SetEnvironmentVariable("Path", $newPath, "Machine")
|
[System.Environment]::SetEnvironmentVariable("Path", $newPath, "Machine")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check if the path already contains $forgeScriptsPath
|
||||||
|
if (-not ($systemPathReference -split ";" | Where-Object { $_ -eq $forgeScriptsPath })) {
|
||||||
|
# Get the updated path (in case it was modified above)
|
||||||
|
$currentPath = [System.Environment]::GetEnvironmentVariable("Path", "Machine")
|
||||||
|
# Append $forgeScriptsPath to the existing path, with proper separation by semicolon
|
||||||
|
$newPath = $currentPath + ";" + $forgeScriptsPath
|
||||||
|
[System.Environment]::SetEnvironmentVariable("Path", $newPath, "Machine")
|
||||||
|
}
|
||||||
|
|
||||||
# Define the base Firefox profiles directory
|
# Define the base Firefox profiles directory
|
||||||
$profilesDir = "$env:APPDATA\Mozilla\Firefox\Profiles"
|
$profilesDir = "$env:APPDATA\Mozilla\Firefox\Profiles"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user