Remove ads from Windows before creating user
This commit is contained in:
parent
6fefa76532
commit
c5536c7c75
3 changed files with 42 additions and 44 deletions
|
@ -33,7 +33,6 @@ function Restore-PersonalApps([Context] $context) {
|
||||||
Install-PersonalDrivers $context;
|
Install-PersonalDrivers $context;
|
||||||
}
|
}
|
||||||
|
|
||||||
. "$PSScriptRoot/../Config/Windows/InstallUser.ps1";
|
|
||||||
. "$PSScriptRoot/../Software/chocolatey/Install.ps1";
|
. "$PSScriptRoot/../Software/chocolatey/Install.ps1";
|
||||||
|
|
||||||
# Backed up applications
|
# Backed up applications
|
||||||
|
|
|
@ -1,6 +1,18 @@
|
||||||
#!/bin/pwsh
|
#!/bin/pwsh
|
||||||
param($context)
|
param($context)
|
||||||
|
|
||||||
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
||||||
|
|
||||||
|
[Context] $context = $context;
|
||||||
|
$tempDir = $context.GetTempDirectory();
|
||||||
|
$startLayoutFile = "start.json";
|
||||||
|
Push-Location "$tempDir";
|
||||||
|
|
||||||
|
Write-Information "Remove MSEdge Icon";
|
||||||
|
$context.RemoveDesktopIcon("Microsoft Edge");
|
||||||
|
|
||||||
Write-Host "Configuring Windows";
|
Write-Host "Configuring Windows";
|
||||||
|
Write-Information "Set old-school icon size";
|
||||||
|
|
||||||
$action = {
|
$action = {
|
||||||
param([Microsoft.Win32.RegistryKey] $userKey)
|
param([Microsoft.Win32.RegistryKey] $userKey)
|
||||||
|
@ -14,3 +26,33 @@ $action = {
|
||||||
}
|
}
|
||||||
|
|
||||||
$context.ProcessDefaultUserKey($action);
|
$context.ProcessDefaultUserKey($action);
|
||||||
|
|
||||||
|
Write-Information "Remove ads from pinned apps";
|
||||||
|
Export-StartLayout $startLayoutFile;
|
||||||
|
|
||||||
|
$startLayout = Get-Content "$startLayoutFile" | ConvertFrom-Json;
|
||||||
|
|
||||||
|
$startLayout.pinnedList = $startLayout.pinnedList | Where-Object {
|
||||||
|
return -not (
|
||||||
|
($_.desktopAppLink -like "*Microsoft Edge*") -or
|
||||||
|
[System.Linq.Enumerable]::Any(
|
||||||
|
@(
|
||||||
|
"*MicrosoftOfficeHub*",
|
||||||
|
"*SpotifyMusic*",
|
||||||
|
"*WhatsApp*",
|
||||||
|
"*PrimeVideo*",
|
||||||
|
"*Netflix*",
|
||||||
|
"*Instagram*",
|
||||||
|
"*Clipchamp*",
|
||||||
|
"*Facebook*"),
|
||||||
|
[System.Func[System.Object,bool]]{
|
||||||
|
param($pattern)
|
||||||
|
return $_.packagedAppId -like "$pattern";
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
$startLayout | ConvertTo-Json | Set-Content $startLayoutFile;
|
||||||
|
Import-StartLayout $startLayoutFile "$env:SystemDrive";
|
||||||
|
|
||||||
|
Pop-Location;
|
||||||
|
Remove-Item -Recurse "$tempDir";
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
#!/bin/pwsh
|
|
||||||
param($context)
|
|
||||||
|
|
||||||
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
|
||||||
|
|
||||||
[Context] $context = $context;
|
|
||||||
$tempDir = $context.GetTempDirectory();
|
|
||||||
$startLayoutFile = "start.json";
|
|
||||||
Push-Location "$tempDir";
|
|
||||||
|
|
||||||
Write-Host "Configuring Windows for Users";
|
|
||||||
Write-Information "Remove MSEdge Icon";
|
|
||||||
$context.RemoveDesktopIcon("Microsoft Edge");
|
|
||||||
|
|
||||||
Write-Information "Remove ads from pinned apps";
|
|
||||||
Export-StartLayout $startLayoutFile;
|
|
||||||
|
|
||||||
$startLayout = Get-Content "$startLayoutFile" | ConvertFrom-Json;
|
|
||||||
|
|
||||||
$startLayout.pinnedList = $startLayout.pinnedList | Where-Object {
|
|
||||||
return -not (
|
|
||||||
($_.desktopAppLink -like "*Microsoft Edge*") -or
|
|
||||||
[System.Linq.Enumerable]::Any(
|
|
||||||
@(
|
|
||||||
"*MicrosoftOfficeHub*",
|
|
||||||
"*SpotifyMusic*",
|
|
||||||
"*WhatsApp*",
|
|
||||||
"*PrimeVideo*",
|
|
||||||
"*Netflix*",
|
|
||||||
"*Instagram*",
|
|
||||||
"*Clipchamp*",
|
|
||||||
"*Facebook*"),
|
|
||||||
[System.Func[System.Object,bool]]{
|
|
||||||
param($pattern)
|
|
||||||
return $_.packagedAppId -like "$pattern";
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
$startLayout | ConvertTo-Json | Set-Content $startLayoutFile;
|
|
||||||
Import-StartLayout $startLayoutFile "$env:SystemDrive";
|
|
||||||
|
|
||||||
Pop-Location;
|
|
||||||
Remove-Item -Recurse "$tempDir";
|
|
Loading…
Reference in a new issue