A PowerShell script to automate the removal of the Phone Link (Microsoft.YourPhone) bloatware from Windows systems. Thing keeps getting on my system somehow, and seeing people talk about it taking up their CPU online worries me.
The script is made for Task Scheduler and does the following:
- Checks if the Phone Link app is installed for all users.
- Removes the app if it is found.
- Logs the results in the user's Documents folder.
- Checks for a valid installation of the Phone Link app.
- Uninstalls the app from all user accounts on the system.
- Logs the outcome of the script.
- Requires Administrative privileges to run the script.
Save the script Remove-PhoneLink.ps1 to a known directory on your system (e.g., C:\Scripts).
-
Open Task Scheduler:
- Press the Windows key and type
Task Scheduler. OR - Press
Win + Sand search for Task Scheduler, then open it.
- Press the Windows key and type
-
Create a New Task:
- Click Create Task on the right-hand panel.
-
General Settings:
- Name the task (e.g.,
Uninstall Phone Link). - Check Run with highest privileges.
- Name the task (e.g.,
-
Set the Trigger:
- Go to the Triggers tab.
- Click New and set the trigger to At startup.
-
Set the Action:
- Go to the Actions tab.
- Click New and select Start a Program.
- In the Program/script field, enter:
powershell.exe - In the Add arguments (optional) field, enter:
Replace
-ep bypass -WindowStyle Hidden -File "C:\Path\To\Remove-PhoneLink.ps1"C:\Path\To\Remove-PhoneLink.ps1with the actual path to the script. - You may wish to set the Start in field to your scripts directory for a shorter Argument field.
-
Save the Task:
- Click OK and provide administrative credentials if prompted.
The script generates a log file in the user's Documents folder, named PhoneRemoval.log. This file contains detailed information about the script's execution, including:
- Whether the app was found.
- Whether the removal was successful.
- Any errors encountered during the process.
2024-12-13 08:00:00 - Successfully removed 'Microsoft.YourPhone' for all users.
2024-12-13 08:00:10 - 'Microsoft.YourPhone' is not installed. No action taken.
2024-12-13 08:00:20 - Failed to remove 'Microsoft.YourPhone'. Error: [Error Details]
-
Ensure Administrative Privileges:
- The script must be run with administrative rights to modify system apps.
-
Check PowerShell Execution Policy:
- If the script fails to run, ensure the execution policy is set to allow scripts:
-ep bypass -WindowStyle Hidden -File "Remove-PhoneLink.ps1"
- If the script fails to run, ensure the execution policy is set to allow scripts:
-
Review Log File:
- Check the log file for details if the script does not behave as expected.