ShareFile-PowerShell icon indicating copy to clipboard operation
ShareFile-PowerShell copied to clipboard

Api Giving error for some device Ids

Open AnaCampoP opened this issue 7 years ago • 0 comments

I am writing a piece of code to get the list of devices that our employees have connected. We have seen that for some Device Id, we get an error when getting the device detail using the Id.

This is our piece of code:

` $sfUsers = Send-SFRequest -Client $client -Entity Accounts\Employees foreach($sfUserId in $sfUsers) { $sfEmployee = Send-SfRequest -Client $client -Entity Users -Id $sfUserId.Id -Expand "Devices"
Write-Host $sfEmployee.Email

    foreach($device in $sfEmployee.Devices) {
        $sfDevice = Send-SfRequest -Client $client -Entity Devices -Id $device.Device.Id
    }
}`

This line: $sfDevice = Send-SfRequest -Client $client -Entity Devices -Id $device.Device.Id is what is giving error when querying for some of the received Ids. Which can be the cause?

AnaCampoP avatar Jun 20 '18 12:06 AnaCampoP