OneDrive Removal Suite v1.1
WebPCDesigns - https://webpcdesigns.com/
===========================================

WHAT THIS IS
------------
A PowerShell script that removes Microsoft OneDrive from a Windows PC:
stops it, runs Microsoft's own uninstaller, clears the leftover folders,
scheduled tasks and registry entries, points Desktop/Documents/Pictures
back at local folders, and optionally stops Windows Update from putting
it back.

REQUIREMENTS
------------
  Windows 7, 8, 10 or 11
  PowerShell 3.0 or newer
  An Administrator PowerShell session

BEFORE YOU RUN IT
-----------------
  1. Back up anything you care about. This script deletes things.
  2. Open OneDrive and make sure everything you want has finished
     syncing and is downloaded to this PC. Files that live only in the
     cloud and were never downloaded are NOT recoverable by this script.
  3. Run it with -DryRun first. It will print every single thing it
     would do and change nothing at all.

HOW TO RUN IT
-------------
  Dry run (changes nothing, do this first):
    powershell -ExecutionPolicy Bypass -File .\OneDrive-Removal-Suite.ps1 -DryRun

  Real run:
    powershell -ExecutionPolicy Bypass -File .\OneDrive-Removal-Suite.ps1

  Real run, and also block OneDrive from reinstalling after a Windows Update:
    powershell -ExecutionPolicy Bypass -File .\OneDrive-Removal-Suite.ps1 -BlockReinstall

A real run asks for two confirmations: you type REMOVE, then you type this
computer's name. Anything else cancels and nothing is touched.

WHAT IT DOES NOT DO
-------------------
  It does NOT delete your C:\Users\<you>\OneDrive folder. Your files stay
  where they are. It tells you how big that folder is and leaves the
  decision to you.

LOGGING
-------
Everything is written to OneDrive-Removal.log on your Desktop, with a
timestamp per action. Use -LogPath to put it somewhere else.

GROUP POLICY
------------
On a work or domain-joined PC, OneDrive may be controlled by Group Policy.
The script detects this and writes OneDrive-GroupPolicy-Remediation.ps1
next to the log. It does NOT run it for you - read it first, and be aware
that on a managed PC your IT administrator can simply re-apply the policy.

IF SOMETHING GOES WRONG
-----------------------
Individual steps fail independently; one failure does not stop the rest.
The count of failed steps is printed at the end and every failure is in
the log. Send us the log if you want a hand: contact@webpcdesigns.com

LICENSE
-------
Free to share, modify and distribute. Attribution appreciated.
No warranty of any kind - you run this at your own risk.
