Codecademy - Powershell

Output Text into the terminal

Write-Host "Hello World!"

See if other commands act on the "date"

Get-Command -Noun Date

Script to write date to the terminal

Write-Host "The Current Date Is:"
Get-Date

Assigning a variable with "Prompt"

$my_input = Read-Host - Prompt "Enter a number"

Using Read-Host to assign a Variable

/$UserName = Read-Host "Please enter your username"
Write-Host "Hello, $UserName!"

Last updated