Hello
what is the best way to add powershell cmdlet calls to the custom tools menu? Currently I only see examples and blogposts how to add third party executables.
rgds
JT
Adding Powershell Cmdlets to Custom Tools Menu
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Adding Powershell Cmdlets to Custom Tools Menu
You can actually do the same thing as in the examples with the third party executables. You provide the path to the PowerShell executable followed by the cmdlet you wish to run for that tool. You end up adding a line that looks something like this:
5=Get-ChildItem;"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" Get-ChildItem C:\Users\DevinL\Desktop
5=Get-ChildItem;"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" Get-ChildItem C:\Users\DevinL\Desktop
DevinL
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Adding Powershell Cmdlets to Custom Tools Menu
A couple alternatives would be to create a script that runs whichever cmdlets you want to run and call that instead of the cmdlet directly. This way you wouldn't have to go into the CustomMenu.inf file every time you want to change what the tool does, you just modify that one script and the CustomMenu would have an extra line like so:
6=Get-ChildItem;"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" C:\Users\DevinL\Desktop\GCI.ps1
You can also create the script as I suggested and package it using PowerShell Studio and call that directly, cutting out the PowerShell executable and creating a line similar to this:
7=Get-ChildItem;"C:\Development\GCI.exe"
6=Get-ChildItem;"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" C:\Users\DevinL\Desktop\GCI.ps1
You can also create the script as I suggested and package it using PowerShell Studio and call that directly, cutting out the PowerShell executable and creating a line similar to this:
7=Get-ChildItem;"C:\Development\GCI.exe"
DevinL
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.