Hi,
I'm running few Invoke-Commands concurrent (for time efficiency) and sometimes after many iterations (10,000 - 100,000) the return command is a falls one. another attempt will cause this error:
[10.7.23.27] Processing data from remote server 10.7.23.27 failed with the following error message: Access is denied. For
more information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (10.7.23.27:String) [], PSRemotingTransportException
+ FullyQualifiedErrorId : AccessDenied,PSSessionStateBroken
why is that happening after so many iterations? is there a affective way to do it at least as fast as this method and yet make it be more stable??
the code looks like this:
$commands = StringToScriptBlock("...")
$test = Invoke-Command -JobName name_a -ComputerName $target_ip -scriptBlock $commands
$commands = StringToScriptBlock("....")
$test = Invoke-Command -JobName name_b -ComputerName $target_ip -scriptBlock $commands
$commands = StringToScriptBlock(".....") #.tgu.Physical.PCIConfigurationHeader.LinkStatus.negotiated_link_width
$test = Invoke-Command -JobName name_c -ComputerName $target_ip -scriptBlock $commands
...
$rc = wait-job -name name_a -timeout 5
$rc = wait-job -name name_b-timeout 5
$rc = wait-job -name name_c -timeout 5
...
$name_a = "0x" + '{0:x}' -f [int](Receive-Job -Name name_a)
$name_b= "0x" + '{0:x}' -f [int](Receive-Job -Name name_b)
$name_c = "0x" + '{0:x}' -f [int](Receive-Job -Name name_c)
...
remove-job -Name name_a -force
remove-job -Namename_b -force
remove-job -Name name_c -force
Start-Sleep -m 200