Added hash check to setupTmp

Fixed issue with custom apps in choco
This commit is contained in:
2023-11-15 10:44:33 +01:00
parent a0bfedb6ad
commit 3499388a7f
8 changed files with 65 additions and 31 deletions

View File

@@ -3,6 +3,14 @@ function UserReg {
param (
[string] $Username
)
# check if User folder exist
if( -not (Test-Path -Path "C:\Users\$Username" -PathType Container) ) {
Write-Host "User folder for $Username not found."
Write-Host "You need to login to $Username in order for its files and registry to be setup."
Write-Host "Press Enter to continue..."
$null = Read-Host
Write-Host "Continuing the script..."
}
Write-Host "Loading $Username's HKU registry hive..."
$UserProfiles = Get-WmiObject Win32_UserProfile | Where-Object { $_.Special -eq $false }
$UserProfile = $UserProfiles | Where-Object { $_.LocalPath.EndsWith("\$Username") }