Welcome › Forums › General PowerShell Q&A › Get mobile devices for cloud users
- This topic has 4 replies, 3 voices, and was last updated 1 year, 10 months ago by
Participant.
-
AuthorPosts
-
-
March 26, 2019 at 4:22 pm #146763
This is part of a larger script and I want to focus my question on a particular aspect.
What I run this command, it returns the first 10 devices and then hangs. I can do a ctrl-c to break out.
Any ideas why? Any way around it. I wan to avoid using the get-mailbox and a for loop to Get-MobileDevice as that would take forever.
Get-MobileDevice | Select-Object -First 10 | ft -
March 26, 2019 at 4:35 pm #146765
Are you sure it hangs? Give it a little more time. Try it.
-
March 26, 2019 at 5:49 pm #146780
The hang can be in next immediate or somewhere down the line in your script. its better to debug using an editor (VSCode or PowerShell ISE) to confirm the point where it hangs.
-
March 26, 2019 at 8:39 pm #146814
No. When I have the command as “Select-Object -First 10” and the scripts returns 10 items it means the script is complete and should return to the prompt but it just sits there.
Its just a single line of powershell code, so there should be no error in the line itself. Try it out. you will see what I mean.
-
March 26, 2019 at 10:33 pm #146823
Of course I tried before I answered. The command line delivers the 10 rows and then takes a few moments to come back and show the prompt. It takes some seconds but it does not hang. The time Powershell needs may depend on the size of the environment.
-
-
AuthorPosts
- The topic ‘Get mobile devices for cloud users’ is closed to new replies.