Click or drag to resize

PowerShell Class

A simple proxy for executing PowerShell commands on Windows machines.

Note Note
This class requires elevated administrative rights.
Inheritance Hierarchy
SystemObject
  Neon.WindowsPowerShell

Namespace:  Neon.Windows
Assembly:  Neon.Common (in Neon.Common.dll) Version: 2.14.0
Syntax
public class PowerShell : IDisposable

The PowerShell type exposes the following members.

Constructors
  NameDescription
Public methodPowerShell
Default constructor to be used to execute local PowerShell commands.
Top
Properties
  NameDescription
Public propertyStatic memberPwshPath
Optional path to the Powershell Core pwsh executable. The PATH environment variable will be searched by default.
Top
Methods
  NameDescription
Public methodDispose
Releases all resources associated with the instance.
Protected methodDispose(Boolean)
Releases all associated resources.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExecute
Executes a PowerShell command that returns a simple string result.
Public methodExecuteJson
Executes a PowerShell command that returns result JSON, subsituting any environment variable references of the form ${NAME} and returning a list of dynamic objects parsed from the table with the object property names set to the table column names and the values parsed as strings.
Protected methodFinalize
Finalizer.
(Overrides ObjectFinalize.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also