Skip to content

Commit

Permalink
Merge branch 'dev' into defender-toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Aug 4, 2023
2 parents c7e527e + 56681a8 commit 5030227
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 279 deletions.
232 changes: 6 additions & 226 deletions src/playbook/Configuration/atlas/components.yml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/playbook/Configuration/atlas/start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ actions:
- !cmd:
exeDir: true
command: 'setx path "%PATH%;C:\Windows\AtlasModules;C:\Windows\AtlasModules\Apps;C:\Windows\AtlasModules\Other;C:\Windows\AtlasModules\Tools;C:\Windows\AtlasModules\Scripts" -m'
# Set path for Atlas PowerShell modules
- !cmd:
exeDir: true
command: 'setx psmodulepath "%psmodulepath%;C:\Windows\AtlasModules\Scripts\Modules" -m'

- !writeStatus: {status: 'Configuring Windows Update'}
- !registryValue: {path: 'HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate', value: 'ExcludeWUDriversInQualityUpdate', data: '1', type: REG_DWORD}
Expand Down
21 changes: 11 additions & 10 deletions src/playbook/Executables/Atlas/1. Software/Remove Edge.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[CmdletBinding()]
param (
[Switch]$UninstallAll,
[Switch]$Exit
[Switch]$AMEWizard
)

$ProgressPreference = "SilentlyContinue"
Expand Down Expand Up @@ -93,8 +93,10 @@ function RemoveWebView {
function UninstallAll {
Write-Warning "Uninstalling Edge Chromium..."
RemoveEdgeChromium
Write-Warning "Uninstalling AppX Edge..."
RemoveEdgeAppx
if (!($AMEWizard)) {
Write-Warning "Uninstalling AppX Edge..."
RemoveEdgeAppx
} else {Write-Warning "AME Wizard should uninstall AppX Edge..."}
if ($removeWebView) {
Write-Warning "Uninstalling Edge WebView..."
RemoveWebView
Expand All @@ -112,19 +114,18 @@ if ($null -ne $(whoami /user | Select-String "S-1-5-18")) {
}
}

if ($Exit) {
$removeData = $true
$removeWebView = $true
$removeWebView = $true
$removeData = $true

if ($AMEWizard) {
UninstallAll
if ($Exit) {exit} else {}
exit
}

$removeWebView = $true
$removeData = $true
if (!($UninstallAll)) {
while (!($continue)) {
Clear-Host; Write-Host "This script will remove Microsoft Edge, as once you install it, you can't normally uninstall it.
Major credit to ave9858: https://gist.github.com/ave9858/c3451d9f452389ac7607c99d45edecc6`n" -ForegroundColor Yellow
Major credit to ave9858: https://gist.github.com/ave9858/c3451d9f452389ac7607c99d45edecc6`n" -ForegroundColor Yellow

if ($removeWebView) {$colourWeb = "Green"; $textWeb = "Selected"} else {$colourWeb = "Red"; $textWeb = "Unselected"}
if ($removeData) {$colourData = "Green"; $textData = "Selected"} else {$colourData = "Red"; $textData = "Unselected"}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<#
.Synopsis
Uninstalls MSIExec uninstaller applications by name.
.Description
Uninstalls applications that use MSIExec uninstallers recursively based on a
wildcarded display name (DisplayName in Registry).
.Parameter Name
The display name of the MSIExec uninstaller application(s) to wildcard
and uninstall.
.Example
# Uninstalls any apps matching "Microsoft Update Health Tools"
Uninstall-MsiexecAppByName -Name "Microsoft Update Health Tools"
#>

function Uninstall-MsiexecAppByName {
param(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$Name
)

if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)) {
throw "Uninstall-MsiexecAppByName: Not running as an administrator!"
}

$uninstallKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
$uninstallKeys = Get-ChildItem -Path $uninstallKeyPath -EA SilentlyContinue

foreach ($key in $uninstallKeys.PSPath) {
$displayName = (Get-ItemProperty -Path "$key").DisplayName
if ($displayName -like "*$Name*") {
$uninstallString = (Get-ItemProperty -Path "$key").UninstallString
if ($uninstallString -like "*MsiExec.exe*") {
$foundKey = $key | Split-Path -Leaf
Write-Warning "Uninstalling $displayName..."
Start-Process -FilePath "msiexec.exe" -ArgumentList "/qn /X$foundKey REBOOT=ReallySuppress /norestart"
}
}
}

if ($null -eq $foundKey) {
throw "Uninstall-MsiexecAppByName: No app found with an MSIExec uninstaller with the display name containing '$Name'."
}
}

Export-ModuleMember -Function Uninstall-MsiexecAppByName
42 changes: 0 additions & 42 deletions src/playbook/Executables/ONED.cmd

This file was deleted.

1 change: 0 additions & 1 deletion src/playbook/Executables/SettingsCache.txt

This file was deleted.

0 comments on commit 5030227

Please sign in to comment.