*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.162
OS: Windows Server 2012 R2 Standard (64 Bit)
Build: v6.3.9600.0
*** Please add details and screenshots as needed below. ***
HI All
I disabled the button from the setting and cleared the other textbox.
May I ask what I did wrong? My English is not good and may not be clear.
So I recorded a video of the execution process. Thanks
- function Fc-cr-ButtonDisable-CkeckAccount
- {
- $button_cr_CheckAccount.Enabled = $false
- }
- function Fn-Cr-CheckADUser
- {
- Fn-Cr-RadioButtonSelectCheck
- if ($global:cr_SamAccount.Length -ge 3)
- {
- try
- {
- Write-Host "Try"
- $temp_ck = Get-ADUser -Identity $global:cr_SamAccount -ErrorAction Stop
- }
- catch
- {
- Fc-cr-ClearProcessView
- Fc-cr-ButtonDisable-CkeckAccount
- $button_cr_CreateAccount.Enabled = $true
- Write-Host "Catch"
- }
- if (!$error)
- {
- Write-Host "IF no err"
- $button_cr_CreateAccount.Enabled = $false
- $richtextbox_cr_ProcessView.Text = "帳號重複"
- if ($global:cr_RadioButtonSelect -match "LineInput")
- {
- $groupbox_cr_LineInput.Enabled = $true
- #$textbox_cr_LineInputSource.Enabled = $true
- }
- }
- }
- }
- $button_cr_CheckAccount_Click={
- #TODO: Place custom script here
- $groupbox_cr_LineInput.Enabled = $false
- $groupbox_cr_StdInput.Enabled = $false
- Fn-Cr-CheckADUser
- }