I am using visual code with PowerShell pro tools, and I am trying to code a Windows Form using powershell and I am having trouble combing the FirstName and Lastname for the Log on name, I am fairly new to powershell pro. Below is what I have coded.
function New-ADUser {
param ([String]$FirstName, [String]$Lastname, [String]$logonname = "$FirstName.$LastName")
}
And this is what turns out when I generate WinForm in Powershell Pro
Add-Type -AssemblyName System.Windows.Forms
$btn_Click = {
New-ADUser -FirstName $txtFirstName.Text -Lastname $txtLastname.Text -logonname $txtlogonname.Text
}
. 'c:\scripts\ADUSERWinform.form.designer.ps1'
$Form1.ShowDialog().
Is there a way or a command that stops the user from inputting information into LogonName box, and When user enter there firstname and Lastname the Logonname box will be (Firstname .Lastname)