troubleshooting Question

PowerShell FORM with an OK prompt

Avatar of CMILLER
CMILLERFlag for United States of America asked on
PowershellVBA
4 Comments1 Solution104 ViewsLast Modified:
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.Controls.Add($label1)
$Form.Width = 1000
$Form.Height = 800
$Form.StartPosition = "CenterScreen"
$Form.ShowDialog()
ASKER CERTIFIED SOLUTION
Brent Challis
Principal: IT

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
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.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros