Class ProcessUtils
Provides utility methods for managing processes.
public static class ProcessUtils
  - Inheritance
 - 
      
      ProcessUtils
 
- Inherited Members
 
Methods
GetCurrentUsername()
Get the current platform username
public static string GetCurrentUsername()
  Returns
- string
 The current username
Exceptions
- PlatformNotSupportedException
 Thrown when the method is called on a non-Windows platform
GetProcessOwnerWmi(int)
Get the owner of a process using WMI
public static string GetProcessOwnerWmi(int processId)
  Parameters
processIdintThe process ID
Returns
- string
 The owner of the process
Exceptions
- PlatformNotSupportedException
 Thrown when the method is called on a non-Windows platform
- Exception
 Thrown when the process is not found or access is denied
KillProcess(string, ILogger)
Kill a process by ID. Can throw exceptions if it is unable to kill the process or if it cannot find the process owner.
public static void KillProcess(string processId, ILogger logger)