Skip to content

Instantly share code, notes, and snippets.

@alainassaf
Created February 7, 2017 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alainassaf/58565d891e2a7bfaabfe13c16ee550e0 to your computer and use it in GitHub Desktop.
Save alainassaf/58565d891e2a7bfaabfe13c16ee550e0 to your computer and use it in GitHub Desktop.
Code Snippet 1 from run-delprof2.ps1
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$wgObjForm = New-Object System.Windows.Forms.Form
$wgObjForm.Text = "Select a Worker Group"
$wgObjForm.Size = New-Object System.Drawing.Size(325,700)
$wgObjForm.StartPosition = "CenterScreen"
$OKButton = New-Object System.Windows.Forms.Button
$OKButton.Location = New-Object System.Drawing.Size(75,620)
$OKButton.Size = New-Object System.Drawing.Size(75,23)
$OKButton.Text = "OK"
$OKButton.DialogResult = [System.Windows.Forms.DialogResult]::OK
$wgObjForm.AcceptButton = $OKButton
$wgObjForm.Controls.Add($OKButton)
$CancelButton = New-Object System.Windows.Forms.Button
$CancelButton.Location = New-Object System.Drawing.Size(150,620)
$CancelButton.Size = New-Object System.Drawing.Size(75,23)
$CancelButton.Text = "Cancel"
$CancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel
$wgObjForm.CancelButton = $CancelButton
$wgObjForm.Controls.Add($CancelButton)
$objLabel = New-Object System.Windows.Forms.Label
$objLabel.Location = New-Object System.Drawing.Point(10,15)
$objLabel.Size = New-Object System.Drawing.Size(280,30)
$objLabel.Text = "The computers in the workergroup will have delprof run against them:"
$wgObjForm.Controls.Add($objLabel)
$objListBox = New-Object System.Windows.Forms.ListBox
$objListBox.Location = New-Object System.Drawing.Point(10,45)
$objListBox.Size = New-Object System.Drawing.Size(275,50)
$objListBox.Height = 500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment