replace Get-ItemPropertyValue with Get-ItemProperty for PS 3.0 compatibility

This commit is contained in:
2025-01-06 13:17:25 -05:00
parent 8fca4894cd
commit 65f8e2c6a1
+1 -1
View File
@@ -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)