itunes section isn't working, commented out
This commit is contained in:
+38
-38
@@ -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) })
|
||||
|
||||
Reference in New Issue
Block a user