diff --git a/FogApi/Private/Get-DynmicParam.ps1 b/FogApi/Private/Get-DynmicParam.ps1 index 349c107..5c58d93 100644 --- a/FogApi/Private/Get-DynmicParam.ps1 +++ b/FogApi/Private/Get-DynmicParam.ps1 @@ -32,17 +32,31 @@ the position to put the dynamic parameter in $attributeCollection.Add($attributes) - $coreObjects = @( - "clientupdater", "dircleaner", "greenfog", "group", "groupassociation", - "history", "hookevent", "host", "hostautologout", "hostscreensetting", "image", - "imageassociation", "imagepartitiontype", "imagetype", "imaginglog", "inventory", "ipxe", - "keysequence", "macaddressassociation", "module", "moduleassociation", "multicastsession", - "multicastsessionassociation", "nodefailure", "notifyevent", "os", "oui", "plugin", - "powermanagement", "printer", "printerassociation", "pxemenuoptions", "scheduledtask", - "service", "setting", "snapin", "snapinassociation", "snapingroupassociation", "snapinjob", - "snapintask", "storagegroup", "storagenode", "task", "tasklog", "taskstate", "tasktype", - "unisearch", "user", "usercleanup", "usertracking", "virus" - ); + if ((Get-FogVersion) -like '1.6*') { + $coreObjects = @( + "group", "groupassociation", "history", "hookevent", "host", "hostautologout", + "hostscreensetting", "image", "imageassociation", "imagepartitiontype", "imagetype", + "imaginglog", "inventory", "ipxe", "keysequence", "macaddressassociation", "module", + "moduleassociation", "multicastsession", "multicastsessionassociation", "nodefailure", + "notifyevent", "os", "oui", "plugin", "powermanagement", "printer", "printerassociation", + "pxemenuoptions", "scheduledtask", "setting", "snapin", "snapinassociation", + "snapingroupassociation", "snapinjob", "snapintask", "storagegroup", "storagenode", "task", + "tasklog", "taskstate", "tasktype", "unisearch", "user", "usertracking", "setting", "user" + ); + } else { + $coreObjects = @( + "clientupdater", "dircleaner", "greenfog", "group", "groupassociation", + "history", "hookevent", "host", "hostautologout", "hostscreensetting", "image", + "imageassociation", "imagepartitiontype", "imagetype", "imaginglog", "inventory", "ipxe", + "keysequence", "macaddressassociation", "module", "moduleassociation", "multicastsession", + "multicastsessionassociation", "nodefailure", "notifyevent", "os", "oui", "plugin", + "powermanagement", "printer", "printerassociation", "pxemenuoptions", "scheduledtask", + "service", "setting", "snapin", "snapinassociation", "snapingroupassociation", "snapinjob", + "snapintask", "storagegroup", "storagenode", "task", "tasklog", "taskstate", "tasktype", + "unisearch", "user", "usercleanup", "usertracking", "virus" + ); + } + $coreTaskObjects = @("group", "host", "multicastsession", "scheduledtask", "snapinjob", "snapintask", "task"); $coreActiveTaskObjects = @("multicastsession", "powermanagement", "scheduledtask", "snapinjob", "snapintask", "task"); } diff --git a/FogApi/Public/Find-FogObject.ps1 b/FogApi/Public/Find-FogObject.ps1 index 15c4889..8d36b5c 100644 --- a/FogApi/Public/Find-FogObject.ps1 +++ b/FogApi/Public/Find-FogObject.ps1 @@ -53,6 +53,9 @@ function Find-FogObject { $paramDict | ForEach-Object { New-Variable -Name $_.Keys -Value $($_.Values.Value);} # $paramDict; Write-Verbose "Building uri and api call for $($paramDict.keys) $($paramDict.values.value)"; + if (($null -eq $coreObject) -and (Get-FogVersion -like '1.6*')) { + $coreObject = "unisearch"; + } switch ($type) { search { if ($coreObject -ne "unisearch") {