I'm experimenting with jobs in PowerShell, but I'm unable to receive results. Here's some output from the shell.
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:\Users\Administrator> dir
Directory: C:\Users\Administrator
Mode LastWriteTime Length Name
---- ------------- ------ ----
d-r-- 6/18/2013 11:52 AM Contacts
d-r-- 6/20/2013 1:00 PM Desktop
d-r-- 6/18/2013 11:52 AM Documents
d-r-- 6/18/2013 11:52 AM Downloads
d-r-- 6/18/2013 11:52 AM Favorites
d-r-- 6/18/2013 11:52 AM Links
d-r-- 6/18/2013 11:52 AM Music
d-r-- 6/18/2013 11:52 AM Pictures
d-r-- 6/18/2013 11:52 AM Saved Games
d-r-- 6/18/2013 11:52 AM Searches
d-r-- 6/18/2013 11:52 AM Videos
-a--- 6/20/2013 12:57 PM 13404 services.html
PS C:\Users\Administrator> Start-Job -ScriptBlock { dir }
Id Name State HasMoreData Location Command
-- ---- ----- ----------- -------- -------
1 Job1 Running True localhost dir
PS C:\Users\Administrator> get-job
Id Name State HasMoreData Location Command
-- ---- ----- ----------- -------- -------
1 Job1 Completed False localhost dir
PS C:\Users\Administrator> Receive-Job -id 1
PS C:\Users\Administrator>
The output above is from a stock Win2008 R2 server that I built and upgraded to a domain controller. It's the only computer in the domain and not associated with any other computers.
I don't have problems receiving results when I run these commands on other computers. What would cause this job to not produce output? Where should I look to debug this problem? I looked through the event logs and didn't find any problems.
Edit: Thanks everyone for your help, but I'm going to consider this question resolved. I believe something was corrupted during the build of the server or installation of a patch since no other computer exhibited the behavior. I've since migrated the data and rebuilt the server and it's working fine.