a little more specific
This commit is contained in:
@@ -14,8 +14,8 @@ Function Add-UserProfilePaths {
|
||||
ForEach ( $profile in (Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList') ) {
|
||||
$profileImagePath = Get-ItemPropertyValue -Path $([System.Environment]::ExpandEnvironmentVariables($profile.PSPath)) -Name ProfileImagePath
|
||||
|
||||
# Skip profiles located in C:\Windows as MSP360 doesn't currently include these when using the %UserProfile% variable
|
||||
If ( $profileImagePath -ilike "*${Env:WinDir}*" ) { Continue }
|
||||
# Skip profiles located outside C:\Users as MSP360 doesn't currently include these when using the %UserProfile% variable
|
||||
If ( !($profileImagePath -ilike "*${Env:SystemDrive}\Users\*") ) { Continue }
|
||||
|
||||
# Build the path we're trying to add
|
||||
$path = Join-Path -Path $profileImagePath -ChildPath $ChildPath
|
||||
|
||||
Reference in New Issue
Block a user