troubleshooting Question

# PowerShell FORM with an OK prompt

PowershellVBA
Im needing to add to this PS Logon FORM Script so I can use to show the user work Information and I want to be able to capture that they acknowledged the information. my thought is to use the OK button to write to an xlsx file their AD Account username and date. Here is the FORM that I am using.

``````Add-Type -AssemblyName System.Windows.Forms
\$Form = New-Object system.Windows.Forms.Form
\$Form.Text = "Information"
\$Icon = [system.drawing.icon]::ExtractAssociatedIcon(\$PSHOME + "\powershell.exe")
\$Form.Icon = \$Icon
\$Font = New-Object System.Drawing.Font("Times New Roman",12,[System.Drawing.FontStyle]::Italic)
# Font styles are: Regular, Bold, Italic, Underline, Strikeout
\$Form.Font = \$Font
#\$Form.BackColor = "Red"

\$label1 = New-Object System.Windows.Forms.Label
\$label1.Location = '5, 5'
\$label1.Size = '900, 700'
\$label1.Text = '1. TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT                2. TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT                 3. TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT'
\$Form.Width = 1000
\$Form.Height = 800
\$Form.StartPosition = "CenterScreen"
\$Form.ShowDialog()
``````
Brent Challis
Principal: IT
###### Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.