ecitsolutions / Autotask

A PowerShell module for Autotask Web Services API
MIT License
65 stars 18 forks source link

Set-ATWSTask -UDF in conjunction with -NoDiskCache #103

Closed Negwoh closed 1 year ago

Negwoh commented 3 years ago

I have encountered an issue where Set-ATWSTask does not appear to have all parameter info created when using -NoDiskCache (on Connect-AtwsWebAPI).

Code: $Param = @{ UDF = @{ Name = "UDF1"; Value = "Content" } } Get-AtwsTask -id 176076 | Set-AtwsTask @Param

Result without -NoDiskCache: Works as expected, no response

Result with -NoDiskCache: image

There is every chance I am missing something I need to use in conjunction with the NoDiskCache flag, any help is appreciated.

klemmestad commented 3 years ago

Thank you for reporting this. I wasn't aware of this bug at all. It turns out that our Autotask tenant does not have any UDFs defined for Tasks, and by faulty logic my code has interpreted this as a general status for all tenants. When you are running from your disk cache all functions are custom built for your tenant. When you run with -nodiskcache you are using generic functions based on the EntityInfo available from our tenant at the time the module release was built.

Since our new module version is ready to go I think the quickest way for me to help you is to release it. With the new version you no longer need any disk cache or custom built functions. The module is well behaved on powershell core, but up until yesterday it still had a few bugs on ps5.1. Those are solved and the module passes all our tests on both powershell core and 5.1, so we should be able to release it this week.

klemmestad commented 3 years ago

Hi @Negwoh, the new module version with a fix for your problem has been published at PowerShell Gallery today.