Maybe wrap the huntress install script in a function that passes all the relevant information?
I did some more testing, and you can include the arguments if you are just running the script normally, but since you cannot include additional arguments when running the script through Pulseway, they will have to be manually added to the script.
Posted
·
Edited by Brandonn Photos did not come through
You are using parameters outside of a function. Parameters can only be defined inside of a function, otherwise you are essentially trying to run the 'param' command.
Unable to use "param" with Powershell Scripts
in PowerShell
Posted · Edited by Brandonn
Fixed Script
They should be there now.
Maybe wrap the huntress install script in a function that passes all the relevant information?
I did some more testing, and you can include the arguments if you are just running the script normally, but since you cannot include additional arguments when running the script through Pulseway, they will have to be manually added to the script.
I believe this would work.
function Install-Huntress { param ( [string]$acctkey, [string]$orgkey, [string]$tags, [switch]$reregister, [switch]$reinstall, [switch]$uninstall, [switch]$repair ) # Rest of the code return "$acctkey - $orgkey - $tags - $reregister - $reinstall - $uninstall - $repair" } Install-Huntress -acctkey 1234 -orgkey 5678 -tags "tag1" -reregister $true -uninstall $false -repair $false
Â