replace Get-ItemPropertyValue with Get-ItemProperty for PS 3.0 compatibility
This commit is contained in:
@@ -783,7 +783,7 @@ Function Get-FileSizes {
|
|||||||
|
|
||||||
# If no path is specified, set $Path to the directory containing user profiles
|
# If no path is specified, set $Path to the directory containing user profiles
|
||||||
If (-not $Path ) {
|
If (-not $Path ) {
|
||||||
$Path = (Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' -Name ProfilesDirectory)
|
$Path = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' -Name ProfilesDirectory).ProfilesDirectory
|
||||||
$Recurse = $true
|
$Recurse = $true
|
||||||
$IncludeHidden = $false
|
$IncludeHidden = $false
|
||||||
}
|
}
|
||||||
@@ -844,7 +844,7 @@ Function WriteToFile_UTF8NoBOM {
|
|||||||
|
|
||||||
# Function to enumerate all user profile folders
|
# Function to enumerate all user profile folders
|
||||||
Function Get-UserProfiles {
|
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 = @()
|
$UserProfilePaths = @()
|
||||||
ForEach ( $userProfile in (Get-ChildItem -Path $ProfilePath | Where-Object { $_.PSIsContainer }) ) {
|
ForEach ( $userProfile in (Get-ChildItem -Path $ProfilePath | Where-Object { $_.PSIsContainer }) ) {
|
||||||
$UserProfilePaths += ,@($userProfile.FullName)
|
$UserProfilePaths += ,@($userProfile.FullName)
|
||||||
|
|||||||
Reference in New Issue
Block a user