diff options
| author | srdusr <trevorgray@srdusr.com> | 2024-06-04 23:16:18 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2024-06-04 23:16:18 +0200 |
| commit | 7594ddfae7bb6649eb7221ee98b64f3bf4113e9b (patch) | |
| tree | a1e55f7549f8bba130c223e713549048a3e42076 /.config/powershell/onedrive.ps1 | |
| parent | 26145af222c573b624069200152261036db6d529 (diff) | |
| download | dotfiles-7594ddfae7bb6649eb7221ee98b64f3bf4113e9b.tar.gz dotfiles-7594ddfae7bb6649eb7221ee98b64f3bf4113e9b.zip | |
Testing
Diffstat (limited to '.config/powershell/onedrive.ps1')
| -rw-r--r-- | .config/powershell/onedrive.ps1 | 12 |
1 files changed, 12 insertions, 0 deletions
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 + |
