Delen via


HostUtilities Class

Definition

Implements utility methods that might be used by Hosts.

public ref class HostUtilities abstract sealed
public static class HostUtilities
type HostUtilities = class
Public Class HostUtilities
Inheritance
HostUtilities

Fields

CreatePSEditFunction

CreatePSEditFunction script string.

PSEditFunction

PSEditFunction script string.

RemoteSessionOpenFileEvent

Open file event.

RemovePSEditFunction

RemovePSEditFunction script string.

Methods

InvokeOnRunspace(PSCommand, Runspace)

Helper method to invoke a PSCommand on a given runspace. This method correctly invokes the command for these runspace cases:

  1. Local runspace. If the local runspace is busy it will invoke as a nested command.
  2. Remote runspace.
  3. Runspace that is stopped in the debugger at a breakpoint.

Error and information streams are ignored and only the command result output is returned.

This method is NOT thread safe. It does not support running commands from different threads on the provided runspace. It assumes the thread invoking this method is the same that runs all other commands on the provided runspace.

RenderFeedback(List<FeedbackResult>, PSHostUserInterface)

Render the feedbacks to the specified host.

Applies to