Skip to content

Latest commit

 

History

History
21 lines (20 loc) · 657 Bytes

File metadata and controls

21 lines (20 loc) · 657 Bytes

Input and output

  1. Use Write-Output to display the result of 100 multiplied by 10.
Write-Output (100 * 10)

  1. Use Write-Host to display the result of 100 multiplied by 10.
Write-Host (100 * 10)

  1. Prompt the user to enter a name, and then display that name in yellow text.
Read-Host "Enter Name" | Write-Host -ForegroundColor Yellow

  1. Prompt the user to enter a name, and then display that name only if it’s longer than five characters. Do this all with a single PowerShell expression—don’t use a variable.
Read-Host "Enter Name" | Where-Object {$_.Length -gt 5}