From 5f61ae4758504b15f2e06d3793a7d172c5d40844 Mon Sep 17 00:00:00 2001 From: David Yoder Date: Mon, 28 Nov 2022 14:13:12 -0500 Subject: [PATCH] itunes section isn't working, commented out --- Cleanup-SystemTempFiles.ps1 | 76 ++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/Cleanup-SystemTempFiles.ps1 b/Cleanup-SystemTempFiles.ps1 index b507cee..c1db0d8 100644 --- a/Cleanup-SystemTempFiles.ps1 +++ b/Cleanup-SystemTempFiles.ps1 @@ -129,48 +129,48 @@ ForEach ( $userProfile in $(EnumUserProfiles) ) { } # Apple iTunes data - If (-not (IsRunning -Name 'itunes') ) { + # If (-not (IsRunning -Name 'itunes') ) { - # Remove Apple software updates downloaded from iTunes - $IPSWBasePath = "${userProfile}\AppData\Roaming\Apple Computer\iTunes" - $IPSW = @() - # iPhone update files - ForEach ( $updateFile in $(Get-ChildItem -Path "${IPSWBasePath}\iPhone Software Updates\*" -File -Include '*.ipsw' -ErrorAction SilentlyContinue) ) { - $IPSW += ,@($updateFile.FullName) - } - # iPad update files - ForEach ( $updateFile in $(Get-ChildItem -Path "${IPSWBasePath}\iPad Software Updates\*" -File -Include '*.ipsw' -ErrorAction SilentlyContinue) ) { - $IPSW += ,@($updateFile.FullName) - } - # iPod update files - ForEach ( $updateFile in $(Get-ChildItem -Path "${IPSWBasePath}\iPod Software Updates\*" -File -Include '*.ipsw' -ErrorAction SilentlyContinue) ) { - $IPSW += ,@($updateFile.FullName) - } + # # Remove Apple software updates downloaded from iTunes + # $IPSWBasePath = "${userProfile}\AppData\Roaming\Apple Computer\iTunes" + # $IPSW = @() + # # iPhone update files + # ForEach ( $updateFile in $(Get-ChildItem -Path "${IPSWBasePath}\iPhone Software Updates\*" -File -Include '*.ipsw' -ErrorAction SilentlyContinue) ) { + # $IPSW += ,@($updateFile.FullName) + # } + # # iPad update files + # ForEach ( $updateFile in $(Get-ChildItem -Path "${IPSWBasePath}\iPad Software Updates\*" -File -Include '*.ipsw' -ErrorAction SilentlyContinue) ) { + # $IPSW += ,@($updateFile.FullName) + # } + # # iPod update files + # ForEach ( $updateFile in $(Get-ChildItem -Path "${IPSWBasePath}\iPod Software Updates\*" -File -Include '*.ipsw' -ErrorAction SilentlyContinue) ) { + # $IPSW += ,@($updateFile.FullName) + # } - # Remove Apple mobile applications downloaded from iTunes - $IPA = @() - ForEach ( $mobileApp in $(Get-ChildItem -Path "${userProfile}\Music\iTunes\iTunes Media\Mobile Applications\*" -File -Include '*.ipa' -ErrorAction SilentlyContinue) ) { - $IPA += ,@($updateFile.FullName) - } + # # Remove Apple mobile applications downloaded from iTunes + # $IPA = @() + # ForEach ( $mobileApp in $(Get-ChildItem -Path "${userProfile}\Music\iTunes\iTunes Media\Mobile Applications\*" -File -Include '*.ipa' -ErrorAction SilentlyContinue) ) { + # $IPA += ,@($updateFile.FullName) + # } - If ( $IPSW ) { - LogMsg "Found Apple software update files" - ForEach ( $path in $IPSW ) { - LogMsg " - Deleting: ""${path}""" - Try { Remove-Item -Path $path -Force -ErrorAction SilentlyContinue } - Catch { LogErr $_.Exception.Message } - } - } + # If ( $IPSW ) { + # LogMsg "Found Apple software update files" + # ForEach ( $path in $IPSW ) { + # LogMsg " - Deleting: ""${path}""" + # Try { Remove-Item -Path $path -Force -ErrorAction SilentlyContinue } + # Catch { LogErr $_.Exception.Message } + # } + # } - If ( $IPA ) { - LogMsg "Found Apple mobile application files" - ForEach ( $path in $IPA ) { - LogMsg " - Deleting: ""${path}""" - Try { Remove-Item -Path $path -Force -ErrorAction SilentlyContinue } - Catch { LogErr $_.Exception.Message } - } - } - } + # If ( $IPA ) { + # LogMsg "Found Apple mobile application files" + # ForEach ( $path in $IPA ) { + # LogMsg " - Deleting: ""${path}""" + # Try { Remove-Item -Path $path -Force -ErrorAction SilentlyContinue } + # Catch { LogErr $_.Exception.Message } + # } + # } + # } # Remove old downloaded application files $OldDownloadedApps = (Get-ChildItem -Path "${userProfile}\Downloads\*" -File -Filter '*.exe' -ErrorAction SilentlyContinue | Where-Object { $_.LastWriteTime -lt ((Get-Date) - $TimeDelta) })