Script Not working (help)

Welcome Forums General PowerShell Q&A Script Not working (help)

Viewing 1 reply thread
  • Author
    • #285007
      Topics: 2
      Replies: 0
      Points: 23
      Rank: Member

      Hi, Can some one advise on the below script. I cant get this to work in a SCCM Task sequence (Does nothing just sits at a blank screen) and if i run it directly from PS ISE it loads but if i change it to show a msg box after ok is clicked i get nothing (Blank Responce)  What i was hoping for was to when click ok, it takes the text inputed from the Textbox (example: X1W10) and the Type of Build from the selected Options (if Standard selected then S- if Admin selected A-) and then change the Hostname in Winpe Part of TS (example S-X1W10 or A-X1W10) and at the same time create a TS Variable for the build type so if Admin Selected create a Variable (Exable: AdminBuild or StandardBuild if Standard selected.) Sorry im new to powershell.


      • This topic was modified 1 week, 2 days ago by kvprasoon. Reason: Code formatting, please see
    • #285022
      Topics: 4
      Replies: 427
      Points: 756
      Helping Hand
      Rank: Major Contributor

      The variables are not assigned values when the radio buttons are clicked or when the computer name box is filled in, some action is required to populate them.  If you move this:

      into the $Button1.Add_Click({}) section, the variables will be populated when the OK button is clicked and your script should work as expected.  I just added [System.Windows.Forms.MessageBox]::Show($OSDFullName) for testing.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.