Press X to exit or any other key to continue?

Question:

Grrr… Noob question here. I want to create a block that basically does this:

Keeps exiting even if I press another key… What am I doing wrong? Thanks!!!

Answer:

You should use “-eq” for comparsion. Simple example:

Here is some reading to be confident with “if-then-else” statements: IF_THEN_ELSE in Powershell

Source:

Press X to exit or any other key to continue? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply