From 7594ddfae7bb6649eb7221ee98b64f3bf4113e9b Mon Sep 17 00:00:00 2001 From: srdusr Date: Tue, 4 Jun 2024 23:16:18 +0200 Subject: Testing --- .config/powershell/onedrive.ps1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to '.config/powershell/onedrive.ps1') diff --git a/.config/powershell/onedrive.ps1 b/.config/powershell/onedrive.ps1 index 625c315..b935130 100644 --- a/.config/powershell/onedrive.ps1 +++ b/.config/powershell/onedrive.ps1 @@ -1,5 +1,13 @@ # onedrive.ps1 +# Helper functions ------------------------ +function force-mkdir($path) { + if (!(Test-Path $path)) { + Write-Host "-- Creating full path to: " $path -ForegroundColor White -BackgroundColor DarkGreen + New-Item -ItemType Directory -Force -Path $path + } +} + # Kill OneDrive with fire ------------------------ Write-Output "Kill OneDrive process" taskkill.exe /F /IM "OneDrive.exe" @@ -66,3 +74,7 @@ Write-Host "Removing OneDrive directory" cd $HOME rm OneDrive -r -force +# Prevents "Suggested Applications" returning +force-mkdir "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content" +Set-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content" "DisableWindowsConsumerFeatures" 1 + -- cgit v1.2.3