-2

I just start doing something with PowerShell and want to make code in which for example I can press 1 and then I take off clock from desktop, but when I press 2 it will be back in his old place. I just don't get that PowerShell syntax. I need some example how to do things like this

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Martins
  • 1
  • 1

1 Answers1

0
$x = Read-Host "Enter 1 or 2:"

if ($x -eq "1") {
    # put code to remove clock here

} elif ($x -eq "2") {
    # put code to reinstate clock here

} else {
    Write-Host "You didn't enter 1 or 2"
}
TessellatingHeckler
  • 27,511
  • 4
  • 48
  • 87