Using PowerShell to Display “Hello World!”

A common task performed when learning a new language is how to display “Hello World!”. Creating such an application with PowerShell is simple. Type the following into a shell (you can omit lines starting with #. Everything after # is a comment) and press Enter:

image

PowerShell scripts can also be saved to a file and executed. Save this Hello World sample to HelloWorld.ps1. Use the standard command-line cd command to navigate to folder in which HelloWorld.ps1 is saved. To execute the script, type the following to the shell:

.HelloWorld.ps1

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset