Is it possible to Add a new command (PowerShell script) by copying it directly into …\Program Files (x86)\Flexera Software\App Portal\Web\Uploads\Commands without going through the Admin (Site Management – Commands & Actions – Script Commands : NewCommand) and then updated some table(s) – like WD_clientCommands?
If not – is there any APIs to Add new command files?
We would then have that command be related to a named Catalog Item (to be called when a user selected ‘Install Now’), we would like to do this using PowerShell also.
We import all our new apps into App Portal using PowerShell, we also update all our existing catalog items using PowerShell, we are investigating adding commands to some of our Catalog Items – just wondering if this is feasible or if anyone has any experience doing this (or if this is a bizarre idea).
Thanks
Jun 09, 2020 07:18 AM
Jun 09, 2020 12:50 PM
You won't be able to run this PowerShell script directly, but it does have a function called AddScriptCommandToEvent to set an existing action on a specified event for a given catalog item. I never created a function to programmatically create new script commands, because we normally just create them from the UI. But as long as they exist, the function in the attached script will connect them to your catalog items.
Jun 09, 2020 05:27 PM - edited Jun 09, 2020 05:28 PM
Jun 09, 2020 12:50 PM
You won't be able to run this PowerShell script directly, but it does have a function called AddScriptCommandToEvent to set an existing action on a specified event for a given catalog item. I never created a function to programmatically create new script commands, because we normally just create them from the UI. But as long as they exist, the function in the attached script will connect them to your catalog items.
Jun 09, 2020 05:27 PM - edited Jun 09, 2020 05:28 PM
Thanks, this was something we were investigating. It's good to know it is possible.
I think we might be able to create just one command and import it in the correct way and then use a template to assign it to future Catalog items. We can pass in different variables each time to the command ( ##MachineName## ##PackageID##) which should run the script to get the specific outcome we want for each catalog item.
Jun 11, 2020 12:08 AM