Skip to content

VS Code does not run PowerShell jobs correctly #120

Closed
@marksrasmussen

Description

@marksrasmussen
$test = {
  function makeform {     
          [void][reflection.assembly]::LoadWithPartialName("System.Windows.Forms")    
          [System.Windows.Forms.Application]::EnableVisualStyles();    

          $form = New-Object Windows.Forms.Form    
          $form.Text = 'Test Form'    

          $form.Add_Shown({$form.Activate()})    
          $form.ShowDialog()    
  }
}

Start-Job { makeform } -InitializationScript $test
---------------------------------
PS C:\WINDOWS\system32> D:\AMS\scripts\MaybeBug.ps1
Id     Name            PSJobTypeName   State         HasMoreData     Location             Command               
--     ----            -------------   -----         -----------     --------             -------               
7      Job7            BackgroundJob   Running       True            localhost             makeform

----------------------------------
Visual Stu
Id     Name            PSJobTypeName   State         HasMoreData     Location             Command                  
--     ----            -------------   -----         -----------     --------             -------                  
1      Job1            BackgroundJob   Failed        False           localhost             makeform    

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions