title: Using GUI Textbox.Text for creating a Folder and adding subfolder
body: <p>I am trying to create a GUI which always should create a folder with the string from a textbox and after add oder Item and folder</p>
  <p>With the First Button i create the folder using the string from the textbox
  With the Butto &quot;save&quot; another folder should be added to the new created folder</p>
  <p>Here my script</p>
  <pre><code>Add-Type -AssemblyName System.Windows.Forms
  Add-Type -AssemblyName System.Drawing
  $window = New-Object System.Windows.Forms.Form
  $window.Width = 1300
  $window.Height = 1000
  $window.Text = &quot;Project Management Dashboard&quot;
  
  $Label1 = New-Object System.Windows.Forms.Label
  $Label1.Location = New-Object System.Drawing.Size(10,10)
  $Label1.Text = &quot;Creator&quot;
  $Label1.AutoSize = $True
  $Label1.ForeColor = &quot;Black&quot;
  $window.Controls.Add($Label1)
   
    $windowTextBox1 = New-Object System.Windows.Forms.TextBox
    $windowTextBox1.Location = New-Object System.Drawing.Size(10,40)
    $windowTextBox1.Size = New-Object System.Drawing.Size (300,500)
   
    $window.Controls.Add($windowTextBox1)
  
  $windowsbuttonquery = New-Object System.Windows.Forms.Button
  $windowsbuttonquery.Location = New-Object System.Drawing.Point(400,800)
  $windowsbuttonquery.Size = New-Object System.Drawing.Size(175,80)
  $windowsbuttonquery.Text = &quot;Project Package&quot;
  $windowsbuttonquery.ForeColor = &quot;Black&quot;
  $window.Controls.Add($windowsbuttonquery)
  
  $windowsbuttonquery.Add_Click({
  
  New-Item -Path C:\Test_Ps1 -Name $windowTextBox1.Text -ItemType directory
  
  }
  )
  
  $save = New-Object System.Windows.Forms.Button
  $save.Location = New-Object System.Drawing.Point(700,800)
  $save.Size = New-Object System.Drawing.Size(175,80)
  $save.Text = &quot;SAVE&quot;
  $save.ForeColor = &quot;Black&quot;
  $window.Controls.Add($save)
  
  $save.Add_Click({
  
  $to = &quot;c:\Test_Ps1\$windowTextBox1.Text&quot;
  
  Copy-Item -Path C:\Test_Ps1\Z -Destination $to
  
  $window.Dispose()
  }
  )
  
  [void]$window.ShowDialog()
  </code></pre>
  <p>Thanks for help.</p>