i will look into PS2EXE to see if that helps.
Below is a snippet of the code i am using that requires a password. Do you see another way to handle this?
invoke-command -computername $connectionserver -scriptblock {
param($vmname, $vmviewPool, $vmuser)
write-host "Updating Horizon for " $vm -ForegroundColor Green
$Username = '<USERNAME>'
$Password = '<PASSWORD>' | ConvertTo-SecureString -AsPlainText -Force
$Credential = New-Object -TypeName pscredential -ArgumentList $Username,$Password
$viewServer = "<HorizonServer>"
add-pssnapin vmware.view.broker
Get-Module -ListAvailable VMware* | Import-Module
connect-hvserver $viewserver -Credential $credential
#add machine to pool
add-hvdesktop -pool $vmviewpool -machines $vmname
#add user to VM In pool
$userresult = get-user -name $vmuser
$usersid = $userresult.sid
$vmresult = get-desktopvm -name $vmname
$vmMachineID = $vmresult.Machine_id
update-userownership -machine_id $vmMachineID -sid $usersid
disconnect-hvserver $viewserver -confirm:$false
} -ArgumentList $vmname, $vmviewPool, $vmuser