I need assitnace in writing new script whcih need to look for stage number and start executing from that stage.
I Understand run key location would be right place for script path. Please correct me if i am wrong.
define global variables(envirnoment varibles)
Restart function(After restart it need to start from stage 2)
End of script
Can anyone please help me with script.
Thanks in advance
Please let me know if i need to post more information because i dnt have any clue how do i do this. Please assit
I doubt anyone can write a script for you based on such a vague request.
Besides, that's not the point of this forum anyway. We are here to help you with specific problems with scripts that you have written yourself.
If you want a script written for you, you can always fill in a request at the Microsoft Script Centre or try hire someone to write the script for you.
I know the importance of forum dude and i give lot of respect for ppl and their time...i posted this for input how to approach for this kind of scenario and i didnt say "write a script for me" . I posted as my expected script.
We have a old kix script which was written as stages so i am re writing those scripts in powershell. Hope i make sense now.
Ok cool. If you have any specific problems with writing your script, please feel free to post them then.
There are so many possible ways to do something like this, it's not even funny. Probably the #1 question I have after reading this is, what is the trigger? In other words, when do you look to examine what phase you're in? Is it on system boot-up or some other event?
If it's on boot-up, that would be fairly easy to implement using the task scheduler.
The bottom line is, we really don't know what you're trying to accomplish from the very limited description you gave.
Thanks for your reply.
Currently we have server 2008 whenever i roll up new server, i need to do set of task such as server rename, joinning domain and other tasks
My idea was to have a master.ps1 which contains different stages like stage 1: server rename , stage 2 : joinning domain, stage 3 .. and goes on.
Trigger i am planning to have a text file which stores stage number whenever server reboots it need to check for text file and stage number and start executing respective stage from master.ps1 file.
#code server rename code.
#write stage 2 number to text file
Reboot system.(After reboot script should execut from stage 2)
#joining domain code.
#write stage 3 number to text file
reboot system.(After reboot script should execut from stage 3)
#write stage 4 number to text file
#end of script
i completed my individual code for each stage. Now i am clue less how can make this into single script.
Please let me know if this can be done in better way.
Have you looked at the free Microsoft Deployment Toolkit? It's designed for doing exactly what you are describing.
I've done something similar in the past, with checkpoints.
The code i've used looks like this
I modified some of your code to adjust my script. I used Switch case for stage and while condition for loop purpose.
Thanks again for your idea.
Glad you found my input helpful
Also if you want to add the parts of the code that you altered here that would be cool, so that others might use it as well for similar scenarios :)
and save it as HTML. But software like Notepad++ is useful because the
keyword will be highlighted.
Because it is interpreted, and i used Notepad++, i can't do some syntax checking, i checking it manually.
If you need syntax checking, you should search the software on internet.
Example codes, save it with extension .html
document.write("Maybe Next Time");
or copy it to your browser and play it :
best accounting essay writer