Extending PowerGUI
From PowerGUI Wiki
Adding nodes
Nodes can be organized at the tree level or inside a folder, allowing you to customize the treeview as you see fit.
To add a node
1. Right-click in the treeview and select New | Node.
2. Enter a name and specify a Get cmdlet to gather the objects.
- If you are unsure of name of the cmdlet, you can search for it using keywords.
3. Click OK to display the objects in the console.
To view the functionality contained in a node
• Right-click the node and select Properties.
You will see which cmdlet is being executed and the default parameters and values. From here, you can refine the values to meet your needs.
For more advanced information, see also Script Nodes
Adding actions
If the action that you require is not available by default, you can add it.
1. From the Actions window, select Add new item | Action.
2. Enter a name and specify a cmdlet to perform the action.
- If you are unsure of the name of the cmdlet, you can search for it using keywords. Only the cmdlets that have the keywords in the description will be listed, allowing you to easily select the required cmdlet.
3. Click OK.
You can now select it to perform the required action.
For more advanced information, see also Script Actions
Adding links
Links allow you to view associated information by gathering together a set of related objects. For example, to find the mailbox stores for all the managers within your organization select the Group node, and browse through the Group Members-> Mailbox -> Mailbox Stores links.
Links and nodes only use get cmdlets because their function is to output information.
You can view the link information for all objects associated with a single node or you can multi-select only the objects that you are interested in.
If the link that you require is not available by default, you can easily add it.
To add links
1. From the Links window, select Add new item | Link.
2. Enter a name and specify the required cmdlet.
- If you are unsure of name of the cmdlet, you can search for it using keywords. Only the cmdlets that have the keywords in the description will be listed allowing you to easily select the required cmdlet.
3. Click OK.
You can now use the link to view the required information.
For more advanced information, see also Script Links
Cmdlet Criteria
For a link to work, the corresponding cmdlet must be able to accept the pipeline of the objects in the grid. If you are not sure, try to execute the corresponding one-liner in the PowerShell window.
For example, if you have a "Mailboxes" node executing get-mailbox cmdlet (and producing a list of mailboxes) you can add a link executing Get-User or Get-MailboxStatistics because the following would work in the command line: Get-Mailbox | Get-User Get-Mailbox | Get-MailboxStatistics
But you cannot add a link with Get-PublicFolder because the following would fail: Get-Mailbox | Get-PublicFolder
If the simple pipeline does not work for what you want to accomplish, you need to add a script link instead.
