Write Script File in Windows PowerShell
How to write a script file in Windows PowerShell to run multiple commands together?
Writting a script file in Windows PowerShell is easy. You can follow these steps:
1. Open Notepad.
2. Write commands in Notepad with one command per line. For example:
Write-Host "Hello World!" test-connection www.microsoft.com -count 1 | format-list Address,ResponseTime
3. Save the script to a file called Hello.ps1.
4. Open a Windows PowerShell window.
5. Type in ".\Hello.ps1" at the command prompt. You will see two commands from the script file get executed:
PS C:\fyicenter> .\Hello.ps1 Hello World! Address : www.microsoft.com ResponseTime : 30
If you are getting errors, see the next tutorial on how to fix it.
2016-11-03, 409👍, 0💬
What is "Credential Manager" in my Windows 7 service list? And how is "Credential Manager" service r...
the computer detect the microphone plugged in, but it's not working with any App. or Desktop soft we...
Can I disable Windows service "McAfee Framework Service" to speedup my computer? Third party service...
What is Apache server? Apache server is an open-source free Web server software that runs websites. ...
Where does Mozilla FireFox 2 store cookie files on my computer? Some cookies are stored to your comp...