i have a custom variable that for some reason works beautifully when i put in the deploy-application.ps1 but if i have it baked into my appdeploytoolkitextensions.ps1 above my other functions the variable doesn’t return anything?
this variable:
[string]$envUserProfilePath = Get-UserProfiles -ExcludeSystemProfiles:$true -ExcludeDefaultUser:$true | Where { $.NTAccount -inotlike “NT SERVICE*” } | ForEach { If ($.NTAccount.Split(’’)[1] -ieq ($env:COMPUTERNAME).Split(’-’)[1]) { $_.ProfilePath }}
just pulls the end users username from the computername so that we can target a specific user on a specific machine. as stated when it’s in the deploy-application it works perfectly but in the extensions it doesn’t do anything.