I have a script that I am porting over to PS7 from version 5.1. If I run the commands in 5.1 the script works as expected but as soon as I put it into PS7, the script fails to run and will just hang. I am not sure what is keeping the script from running.
Thank you for your response. I understand your skepticism on my script working in 5.1 but the for-each wrapper is different when I run it in 5.1. The stuff inside the For-Each is identical in my 5.1 script. I would like to make it less convoluted and easier for someone to read. I do have a question for you though.
In your one line script, the -wait -for WinRM, does it require that I enter something for the WinRM or is it looking for the WinRM services to start up before it continues on to the next server? I realize the way I have it written it will target the first 25 servers in my $ListOfServers variable and this is what I want as I am trying to use the script to reboot over 200 servers.
… since I couldn’t explain it better than the documentation … …
The cmdlet Restart-Computer would more or less restart all provided computers at once. If you need to throttle this you’d need to do that “outside” of the command.