added function EnumUserProfiles
This commit is contained in:
@@ -605,7 +605,7 @@ function Get-LiquidFilesCLI {
|
||||
|
||||
# Function to determine if an app is running
|
||||
function IsRunning ([Parameter(ValueFromPipeline=$true)][string]$Name) {
|
||||
$RunningInstances = Get-Process | Where { $_.Name -ilike $Name }
|
||||
$RunningInstances = Get-Process | Where-Object { $_.Name -ilike $Name }
|
||||
If ( $RunningInstances ) { Return $true } Else { Return $false }
|
||||
}
|
||||
|
||||
@@ -734,5 +734,15 @@ function WriteToFile_UTF8NoBOM {
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
|
||||
# Function to enumerate all user profile folders
|
||||
function EnumUserProfiles {
|
||||
$ProfilePath = (Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' -Name ProfilesDirectory)
|
||||
$UserProfilePaths = @()
|
||||
ForEach ( $userProfile in (Get-ChildItem -Path $ProfilePath | Where-Object { $_.PSIsContainer }) ) {
|
||||
$UserProfilePaths += ,@($userProfile.FullName)
|
||||
}
|
||||
Return $UserProfilePaths
|
||||
}
|
||||
|
||||
Setup-MSPDirectories
|
||||
Setup-LogFile
|
||||
Reference in New Issue
Block a user