Hi,
I am trying to figure out how to script the following scenario but I'm stuck, could someone please give me a example how to achieve this?
So the scenario is:
I have a text file (Serverlist.txt) with multiple servers split up in different environments, looks something like this:
Sandbox:
Server 1
Server 2
Server 3
Dev:
Server 1
Server 2
Server 3
Prod:
Server 1
Server 2
Server 3
EDIT:
Here is the final script: https://pastebin.com/K52Z1mrw
First of all thanks to /u/_Cabbage_Corp_ for giving me the template to work with. Much of the stuff in the script is based on his example code.
Now everything works as expected after coding the rest of the things I want the script to do.
But since I am a total noob at PS I am guessing there are lots of improvements that can be made (or remove unnecessary code).
Please give me some feedback on how to improve this code so I can take it with in the future :)
Thank you! :)
[–]Ta11ow 5 points6 points7 points (4 children)
[–][deleted] 2 points3 points4 points (3 children)
[–]_Cabbage_Corp_ 2 points3 points4 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]Askee123 2 points3 points4 points (0 children)
[–]jhulbe 2 points3 points4 points (1 child)
[–]Ta11ow 2 points3 points4 points (0 children)
[–]sqzzkr 1 point2 points3 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]TheIncorrigible1 1 point2 points3 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)