PowerShell Objects is a component library that provides simple plug-and-play interfaces to PowerShell that can be easily integrated into any application. The PowerShell Objects client components can be used to securely (SSH) communicate with remote servers and pass data through standard streams or through PowerShell Objects. The included PSHost component enables developers to embed a PowerShell scripting engine directly within any Windows application. Combined these components offer unprecedented access to PowerShell scripting to application developers. Included Components
How It WorksPowerShell Server can be run as a standalone application on your Windows Desktop that sits quietly in your taskbar notification tray, or as a Windows Service that runs in the background. The PowerShell Objects PSClient component is then be configured to connect to the instance of PowerShell Server and execute arbitrary PowerShell commands remotely in a secure manner, using the SSH protocol. The results of the command execution are then returned as a list of objects, each one with a base type, an (optional) value and a collection of named properties. Here is an example of using the .NET Edition of PowerShell Objects to connect to a remote machine and execute a PowerShell 'get-process' command: Psclient1.SSHUser = "DomainUser" ; Psclient1.SSHPassword = "****" ; Psclient1.SSHHost = "FooDomain" Psclient1.Logon(); Psclient1.Execute( "get-process" ); for ( int i = 0; i < Psclient1.PSObjectCount; i++) { Psclient1.PSObjectIndex = i; foreach (PowerShellInside.PowerShellSSH.PSProperty prop in Psclient1.PSObject.Values) { Console.Write( "{0}:{1}/r/n" , prop.Name, prop.Value); } } Psclient1.Logoff();
Component Highlights
|