Hey everyone! I'm running into a bit of a wall here. I've been trying to pass variables to the Get-MgDevice and Get-MgDeviceManagementManagedDevice cmdlets, but it just isn't working. I've included screenshots that show the $id variable I'm trying to use. Despite uninstalling and reinstalling Graph and my modules multiple times, I'm still stuck. Does anyone have any ideas or insights on what might be going wrong?
1 Answer
You might need to expand the variable when using it. Try piping your command like this: `get-.... | Select-Object -ExpandProperty Id`. That should simplify things and just give you the ID as a result.

Also, great tip! Using ExpandProperty really saved me there. Thanks a bunch!