-
Notifications
You must be signed in to change notification settings - Fork 142
PowerOrion A Module for PowerShell
PowerOrion is a PowerShell Module, based on the Orion SDK. Essentially it is an attempt to take some of the sample scripts included in the SDK, and to convert those to PowerShell Cmdlets
Converting this code into a module has several benefits:
- By creating Cmdlets, actions can be performed much faster. For example, to add nodes, rather than editing a script and calling that, you can now just call something like
$swis = Connect-Swis -UserName admin -Password "" -Hostname 10.160.5.75
New-OrionNode -SwisConnection $swis -IPAddress 10.160.5.10
What this boils down to is when writing your own scripts, these can now be much smaller in size, and faster to develop, as a lot of the “plumbing” is already done (instead of having to copy and paste a 75 line script, you can now achieve the same in a couple of lines).
-
It’s more intuitive, and fits conventional PowerShell Verb-Noun naming conventions
-
By building in error handling, and through the use of defaults and parameter sets, there is less chance for user error. For example, when building statements in either the console or the IDE it can prompt on possible options for parameters.
-
Built-in documentation. By using native functionality in PowerShell help and examples can be included with the modules.
To install PowerOrion, follow these steps:
-
Visit https://github.com/solarwinds/OrionSDK, click the green "Clone or download" button, and then click "Download ZIP".
-
Extract the zip to a temp directory.
-
Copy the
PowerOrion
directory from theSamples\PowerShell
directory you just extract to either:-
$pshome\Modules
(%windir%\System32\WindowsPowerShell\v1.0\Modules
) - this will install PowerOrion system-wide. -
$home\Documents\WindowsPowerShell\Modules
(%UserProfile%\Documents\WindowsPowerShell\Modules
) - this will install PowerShell for the current user only.
-
Alternatively you can try installing the module from an admin PowerShell session:
Install-Module PowerOrion
Now that PowerOrion is installed, you can load it into the current PowerShell session with:
Import-Module PowerOrion
To see a list of all commands:
Get-Command -Module PowerOrion
For more information on installing and using modules see
Get-Help About_Modules
- About SWIS
- Connecting to SWIS
- SWQL Functions
- REST
- PowerShell
- Alerts
- Creating custom properties
- Poller Types
- Network Performance Monitor
- NetFlow Traffic Analyzer
- Network Configuration Manager
- IP Address Manager
- Server & Application Monitor
- Log Analyzer
- Schema reference