Scripting Guys: I am looking for a PS script to read a text file which has some operational commands which needs to be executed line by line. RRS feed

  • Question

  • Hi,

    Really fed up with a manual work and concentrating to automate my work. Your help needed :) .


    We have some commands which we are executing one by one on PowerShell. The command is like below:


    .\<application Batch file> -f <.csv file patch>-e UTF-8 -i attributes.ServerId -o "application specific directory" -x -u <user name>


    .\satish.bat -f D:\temp\satish\import.csv -e UTF-8 -i attributes.ServerId -o "ORG/INDIA/IN-123" -x -u satish_m

    Like the above we have 1000+ commands



    We have an application batch file which reads a .csv file and the file content will be dumped in to application specific directory as we specified in the command line.

    Here each command is asking for a password of <username>.

    My requirement:

    I want to create a text / bat file which consists above bunch of command lines.

    Script has to execute line by line (note: time will take to complete one command and it is dynamic)

    Password should ask only fist time (or) read password from external file every time without manual input.

    Please guys help me out on this. I am new to POWERSHELL.


    • Moved by Bill_Stewart Monday, December 17, 2018 6:36 PM This is not "scripts on demand"
    Thursday, October 4, 2018 7:51 AM

All replies