Where can I get more documentation about Invoke-SwisVerb parameters and other powershell integration?
Hi phillipscc! Your best bet is going to be to download the SWQL Studio utility that comes with the PowerShell SDK (https://www.github.com/solarwinds/OrionSDK/releases). Load it up, provide it with the host & credentials to your SolarWinds web console. Once you're in, check out Metadata > Metadata.VerbArgument. That'll give you a list of all the verbs and their parameters with their types:
Then check out the examples out on the same repo where you got the SDK: https://github.com/solarwinds/OrionSDK/tree/master/Samples/PowerShell
While that information is VERY helpful, it is a bit obscure. I'm new to PowerShell, but the one thing I have learned is to use "Get-Help" I'm looking for information similar to:
PS C:\Windows\system32> help Get-Service -full
NAME
Get-Service
SYNOPSIS
Gets the services on a local or remote computer.
SYNTAX
Get-Service [[-Name] <String[]>] [-ComputerName <String[]>] [-DependentServices] [-Exclude <String[]>] [-Include
<String[]>] [-RequiredServices] [<CommonParameters>]
Get-Service [-ComputerName <String[]>] [-DependentServices] [-Exclude <String[]>] [-Include <String[]>]
[-RequiredServices] -DisplayName <String[]> [<CommonParameters>]
[-InputObject <ServiceController[]>] [-RequiredServices] [<CommonParameters>]
DESCRIPTION
The Get-Service cmdlet gets objects that represent the services on a local computer or on a remote computer,
including running and stopped services.
You can direct Get-Service to get only particular services by specifying the service name or display name of the
services, or you can pipe service objects to Get-Service.
PARAMETERS
-ComputerName <String[]>
Gets the services running on the specified computers. The default is the local computer.
Type the NetBIOS name, an IP address, or a fully qualified domain name of a remote computer. To specify the
local computer, type the computer name, a dot (.), or "localhost".
This parameter does not rely on Windows PowerShell remoting. You can use the ComputerName parameter of
Get-Service even if your computer is not configured to run remote commands.
Required? false
Position? named
Default value Local computer
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-DependentServices [<SwitchParameter>]
Gets only the services that depend upon the specified service.
By default, Get-Service gets all services.
Default value False
Accept pipeline input? false
-DisplayName <String[]>
Specifies the display names of services to be retrieved. Wildcards are permitted. By default, Get-Service gets
all services on the computer.
Required? true
Default value All services
Accept wildcard characters? true
.
Specifically, the parameter descriptions. Part of knowing how to use things like this is knowing what's possible and what the available parameters are. I was hoping for a more comprehensive reference.
You can do 'Get-Help Invoke-SWISVerb' but it's a bit sparse.
The main things are:
SWISConnection should be a variable from a 'connect-swis'
EntityName is the bit on the left in SWQL Studio (aka Orion.Nodes)
After the -Verb parameter will be a set of the required parameters and their values (derived from SWQL Studio).
Unfortunately currently the snap-in is more SDK than admin friendly. There have been some community efforts at starting a module for it to make it easier, but we haven't gotten very far yet.
Aside from the examples and that link to the wiki there's nothing else to be had.
Some of the API functions have been added to micheal100's PowerOrion module. These are much more admin-friendly and include at least some basic documentation that is accessible to PowerShell's "Get-Help".
OrionSDK/Samples/PowerShell/PowerOrion at master · solarwinds/OrionSDK · GitHub