diff --git a/Tools.ps1 b/Tools.ps1 index d67c0fd..62682d0 100644 --- a/Tools.ps1 +++ b/Tools.ps1 @@ -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 \ No newline at end of file