This is a basic PowerShell script, when this script is run, it prints "Hello World".
You can watch the youtube video, related to this post here.
[embed]https://youtu.be/vjc1KeMy53k[/embed]
Follow the following sequence.
- Open any editor.
- Type Write-Output "Hello World"
- Save the file as print-hello-world.ps1, or you can use any name you want, but the file extension should be .ps1.
- Open PowerShell
- Go To Location Where your script is saved.
- And run the script by just provining the file name and Hit Enter.
PS D:\LearningPowerShell\PowerShellBlogCode> .\print-hello-world.ps1
Hello World
PS D:\LearningPowerShell\PowerShellBlogCode>
PowerShell code Execution ScreenShot.
[caption id="attachment_669" align="alignnone" width="1010"]
PowerShell Hello World Script[/caption]