KelvinTegelaar / AutotaskAPI

Autotask 2020.2 REST API PowerShell wrapper

Home Page:https://cyberdrain.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] ID not passing by pipeline

chrisjantzen opened this issue · comments

Describe the bug
The docs show that you can bass ID through the pipeline and it will get it from the body by name. The examples are related to ticket lists and replacing all company web addresses with www.google.com. I first noticed this in my own scripts and it wasn't a big deal, it's easy enough to workaround. I recently used your PowerShellWarrantyReports script though to try to update warranties in Autotask and on the first update it attempts it asks for you to manually enter the ID because it won't pick it up from the pipeline. I've tried troubleshooting and can't for the life of me figure out why it's not working!

To Reproduce
Steps to reproduce the behavior:

  1. The $TicketList example replicates this behaviour for me.
$TicketList = Get-AutotaskAPIResource -Resource Tickets -SimpleSearch "title eq Nope!"
$ticketlist | ForEach-Object { $_.status = "12" }
$ticketlist | Set-AutotaskAPIResource -Resource Tickets
  1. Attempting the above gives me the following:
cmdlet Set-AutotaskAPIResource at command pipeline position 1
Supply values for the following parameters:
ID:

Expected behavior
It should find ID in the object obtained from Get-AutotaskAPIResource and use that for the update.

Screenshots
powershell_rT0Y0FBylf

Desktop (please complete the following information):

  • OS: Windows 10
  • PowerShell version: 5.1.19041.1320