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

PSCustomObject and Inventory PowerShell Scanner

So we have a PowerShell scanner in Inventory to list what WiFi profiles are on a laptop. 

$list=(netsh.exe wlan show profiles) -match '\s{2,}:\s'

foreach($item in $list){
$array = $item.split(":")

$addedby = $array[0]
$profilename = $array[1]

[PSCustomObject]@{
"Profile Name" = $profilename.trim()
"Added By" = $addedby.trim()
}
}

 This works great at allowing us to see if laptops have any other WiFi profiles installed than the group policy added one (which fortunately doesn't show up). Where one of our BYOD WiFi networks have been added, we have a tool to remove just these profiles (leaving any home WiFi profiles in place).

The tool works fine. Though we noticed early on that where no other profiles exist, the PowerShell scanner record doesn't get updated. I believe this to be because the PSCustomObject is in the foreach loop.

How can I get the PS Scanner record to update to show no WiFi profiles?

0

Comments

4 comments
Date Votes
  • Official comment

    We have some new nightly builds that resolve this "PowerShell scanner not clearing results when null" bug. Not exactly sure when this fix will make it into a full release, but should be in the coming weeks.

    PDQ Deploy

    https://download.pdq.com/release/19/Deploy_19.3.301.0.exe

    PDQ Inventory

    https://download.pdq.com/release/19/Inventory_19.3.301.0.exe

  • That's a bug in the PowerShell Scanner. An empty scan should update Inventory, but it currently doesn't. Please contact support@pdq.com to let them know you're running into this.

    1
  • Same bug here

    This is a very annoying bug producing false results.

    I hope it gets fixed really quick because having to export/delete/reimport your scanner to clean results is a big pain.

    Powershell scanner is really good and you advertised it quite a bit so let's hope this is fixed ASAP.

    Should i contact support too ?

     

     

     

     

     

     

    1
  • Should i contact support too ?

    Yes. The more tickets Support gets, the more likely it is a problem will get fixed.

    0