0

I am developing a tool which uses powershell script to search for new windows updates for the machine. Currently by using the 'invoke-command' i am remotely accessing the various build controllers,virtual machines and hosts and running this powershell script. But invoke-command is unable to fetch the update details every time whenever it is executed. the usage of invoke-command as follows:

invoke-command -computername buildcontroller1 -filepath searchupdates.ps1 -credential $myceredential

if i run this command, 1st time i will get the output, but when again if i run this command after 2 to 3 hours or after 1 day,its not retrieving the update details. can anyone please tel me the reason for this.

Mahadev Swamy
  • 131
  • 1
  • 9

1 Answers1

0

I cannot tell you the reason for this.

I suspect the reason for needing to ask is an absence of error handling in the searchupdates.ps1 script.

mjolinor
  • 66,130
  • 7
  • 114
  • 135
  • I am using necessary error handling methods in searchupdates.ps1, initially i executed "enable-psremoting" command on this build controller and this script will be executed on the build controllers where snapshots will be applied. is this causing any error?? – Mahadev Swamy Apr 10 '13 at 12:22
  • I cannot say. If the script is not producing any output, and not producing any errors then logically it's either not finding anything to do, or it's encountering errors and failing to handle and report them. – mjolinor Apr 10 '13 at 12:39