From 65f8e2c6a182e44ac59e9237a13aa86c991536d8 Mon Sep 17 00:00:00 2001 From: David Yoder Date: Mon, 6 Jan 2025 13:17:25 -0500 Subject: [PATCH] replace Get-ItemPropertyValue with Get-ItemProperty for PS 3.0 compatibility --- Cleanup-SystemTempFiles.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cleanup-SystemTempFiles.ps1 b/Cleanup-SystemTempFiles.ps1 index 3b393c0..02775cd 100644 --- a/Cleanup-SystemTempFiles.ps1 +++ b/Cleanup-SystemTempFiles.ps1 @@ -2,7 +2,7 @@ # Function to enumerate all user profile folders Function Get-UserProfiles { - $ProfilePath = (Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' -Name ProfilesDirectory) + $ProfilePath = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' -Name ProfilesDirectory).ProfilesDirectory $UserProfilePaths = @() ForEach ( $userProfile in (Get-ChildItem -Path $ProfilePath | Where-Object { $_.PSIsContainer }) ) { $UserProfilePaths += ,@($userProfile.FullName)