updated Get-UserProfiles func

This commit is contained in:
2023-10-06 16:14:34 -04:00
parent 06fdd45c36
commit feaab79d35
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ If ( Test-Path $ADSKInst ) {
# TODO: Evaluate system restore points and delete them if they take up too much space
# Remove files from user profile directories
ForEach ( $userProfile in $(EnumUserProfiles) ) {
ForEach ( $userProfile in $(Get-UserProfiles) ) {
# Remove all user temp files older than 7 days
$OldTempFiles = Get-ChildItem -Path "${userProfile}\AppData\Local\Temp" -ErrorAction SilentlyContinue | Where-Object { $_.LastWriteTime -lt ((Get-Date) - $TimeDelta) }
+1 -1
View File
@@ -764,7 +764,7 @@ Function WriteToFile_UTF8NoBOM {
}
# Function to enumerate all user profile folders
Function EnumUserProfiles {
Function Get-UserProfiles {
$ProfilePath = (Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' -Name ProfilesDirectory)
$UserProfilePaths = @()
ForEach ( $userProfile in (Get-ChildItem -Path $ProfilePath | Where-Object { $_.PSIsContainer }) ) {