Important Notice: On February 29th, this community will be put into read-only mode. All existing posts will remain but customers will be unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Custom Field not populating with [pscustomobject]

Hi Team,

I have a script that returns a True/False value. The script seems to run fine via PDQ, and it does locally, but the corresponding custom field I have in PDQ Inventory isn't being populated. How do I go about troubleshooting this? I'm not sure where to start.

The code is as follows:

[pscustomobject]@{
  DataHarverster11Compatible = $DataHarverster11Compatible
  }

 

0

Comments

9 comments
Date Votes
  • Are you running this as a PowerShell Scanner?

    https://link.pdq.com/docs-PDQInventory?powershell-scanner.htm

    0
  • I am yes. 

    New Scanner --> PowerShell --> pointing at the .ps1

    0
  • The results will show up in the PowerShell tab of the Computer window.

    0
  • No dice there either. Is there any logging or something I can check? 

    0
  • Did you run the Scan Profile that contains the PowerShell Scanner you created against a target? You'll be able to find some information on the Scans tab.

    0
  • Yessir, it tells me the scan was successful but nothing in PowerShell and the Custom Field has no value.

    The call in my original post, can you confirm this isn't used to populate a corresponding custom field in the actual Custom Field category? Seems I'm misunderstanding something here or the use of custom field is in more than one place, or something?

    An there's no logging I can look at to see what's going on?

    0
  • Ah, have just spotted the drop down list for the various scan profiles. I can see the result in there

    0
  • The call in my original post, can you confirm this isn't used to populate a corresponding custom field in the actual Custom Field category?

    Correct. PowerShell Scanners cannot populate Custom Fields. Custom Fields are essentially notes that you have to manually fill in. The only way to interact with them programmatically is by importing a CSV file, either through the GUI or command line. https://link.pdq.com/docs-PDQInventory?importwizard.htm

    Ah, have just spotted the drop down list for the various scan profiles. I can see the result in there

    Sorry, I forgot to mention that dropdown. It's been a while since I've actually used Inventory.

    Now that you've found the data and can see that it's returning what you expected, I recommend building Collections and/or Reports. Each PowerShell Scanner gets its own Table, and the names all start with PowerShell.

    An there's no logging I can look at to see what's going on?

    If I remember correctly, the log will only show up at the top of the PowerShell tab of a computer if the scan failed.

    0
  • Thanks for clarifying, that all makes sense.

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post