SharepointXLStoXLSX/ConfigForm.ps1
2025-02-19 14:21:24 -08:00

25 lines
916 B
PowerShell

Add-Type -AssemblyName System.Windows.Forms
$configForm = New-Object System.Windows.Forms.Form
$configForm.Text = "SharePoint Configuration"
$configForm.Size = New-Object System.Drawing.Size(400,300)
# Add controls for all configuration fields
$lblSiteUrl = New-Object System.Windows.Forms.Label
$lblSiteUrl.Text = "Site URL:"
$lblSiteUrl.Location = New-Object System.Drawing.Point(20,20)
$txtSiteUrl = New-Object System.Windows.Forms.TextBox
$txtSiteUrl.Location = New-Object System.Drawing.Point(20,40)
$txtSiteUrl.Size = New-Object System.Drawing.Size(340,20)
$btnSave = New-Object System.Windows.Forms.Button
$btnSave.Text = "Save"
$btnSave.Add_Click({
Save-Config -SiteUrl $txtSiteUrl.Text -ProductionLibrary "Documents" -TempLibrary "Documents/Temp" -ClientId "" -ClientSecret ""
$configForm.Close()
})
$configForm.Controls.AddRange(@($lblSiteUrl, $txtSiteUrl, $btnSave))
$configForm.ShowDialog()