Fix "handle is invalid" error on AppVeyor
This commit is contained in:
parent
cc64b31741
commit
1ec5676f25
3 changed files with 18 additions and 2 deletions
|
@ -16,6 +16,7 @@ namespace Microsoft.PowerShell.Linux.Host
|
|||
public MyHost(Listener Listener)
|
||||
{
|
||||
this.Listener = Listener;
|
||||
this.myHostUserInterface = new MyHostUserInterface(Listener.HasUI);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -44,7 +45,7 @@ namespace Microsoft.PowerShell.Linux.Host
|
|||
/// A reference to the implementation of the PSHostUserInterface
|
||||
/// class for this application.
|
||||
/// </summary>
|
||||
private MyHostUserInterface myHostUserInterface = new MyHostUserInterface();
|
||||
private MyHostUserInterface myHostUserInterface;
|
||||
|
||||
/// <summary>
|
||||
/// A reference to the runspace used to start an interactive session.
|
||||
|
|
|
@ -187,8 +187,15 @@ OPTIONS
|
|||
set { this.exitCode = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether UI should exit.
|
||||
/// </summary>
|
||||
public bool HasUI;
|
||||
|
||||
public Listener(string initialScript, bool loadProfiles)
|
||||
{
|
||||
HasUI = (initialScript == null) ? true : false;
|
||||
|
||||
// Create the host and runspace instances for this interpreter.
|
||||
// Note that this application does not support console files so
|
||||
// only the default snap-ins will be available.
|
||||
|
|
|
@ -17,10 +17,18 @@ namespace Microsoft.PowerShell.Linux.Host
|
|||
/// </summary>
|
||||
internal class MyHostUserInterface : PSHostUserInterface, IHostUISupportsMultipleChoiceSelection
|
||||
{
|
||||
/// <summary>
|
||||
/// Public constructor
|
||||
/// </summary>
|
||||
public MyHostUserInterface(bool hasUI)
|
||||
{
|
||||
myRawUi = (hasUI) ? new MyRawUserInterface() : null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A reference to the PSRawUserInterface implementation.
|
||||
/// </summary>
|
||||
private MyRawUserInterface myRawUi = new MyRawUserInterface();
|
||||
private MyRawUserInterface myRawUi;
|
||||
|
||||
/// <summary>
|
||||
/// Gets an instance of the PSRawUserInterface class for this host
|
||||
|
|
Loading…
Reference in a new issue