30 lines
671 B
PowerShell
30 lines
671 B
PowerShell
|
|
<#
|
||
|
|
Author: Gabe Kerntke
|
||
|
|
Date: 01-16-2024
|
||
|
|
|
||
|
|
.Synopsis
|
||
|
|
Script deletes each users firefox appdata folder
|
||
|
|
|
||
|
|
.Modified
|
||
|
|
2024-06-23 (GabeK) - Original script created
|
||
|
|
|
||
|
|
#>
|
||
|
|
|
||
|
|
#Region Functions
|
||
|
|
|
||
|
|
Function DeleteFolder {
|
||
|
|
$users = Get-ChildItem C:\Users
|
||
|
|
foreach ($user in $users) {
|
||
|
|
$path = "C:\Users\$($user.Name)\AppData\Local\Microsoft\Teams"
|
||
|
|
if (Test-Path $path) {
|
||
|
|
Remove-Item $path -Force -Recurse
|
||
|
|
Write-Output "$user Team's Appdata folder has been deleted."
|
||
|
|
}
|
||
|
|
else {
|
||
|
|
Write-Output "The path $path does not exist for $user."
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
#Region Script Start
|
||
|
|
DeleteFolder
|