0
0
PowerShellscripting~3 mins

First PowerShell command

Choose your learning style9 modes available
Introduction
PowerShell lets you control your computer by typing commands. The first command helps you see how it works.
You want to check if PowerShell is ready to use.
You want to print a simple message on the screen.
You want to learn how to run commands in PowerShell.
You want to test if your script is working.
Syntax
PowerShell
Write-Output "Your message here"
Write-Output prints text or data to the screen.
Use double quotes "" to write text messages.
Examples
Prints the message Hello, world! on the screen.
PowerShell
Write-Output "Hello, world!"
Prints the current date and time using a command inside the message.
PowerShell
Write-Output "Today is $(Get-Date)"
Prints the number 123.
PowerShell
Write-Output 123
Sample Program
This command prints a welcome message to show PowerShell is working.
PowerShell
Write-Output "Welcome to PowerShell!"
OutputSuccess
Important Notes
You can also use the alias 'echo' instead of Write-Output for simple messages.
PowerShell commands are not case sensitive, so 'write-output' works too.
Try running the command in PowerShell console to see the output immediately.
Summary
Write-Output shows messages or data on the screen.
It is the simplest way to start using PowerShell.
You can print text, numbers, or results of other commands.