The switch data type is used to control whether a switch (as in arguments or options passed to a function or command) is provided for the function/command or not. Suppose that there is a function called Switch-Demo that can accept -Force and -Quiet switches. These switches just work as toggles. What we care about them is whether they exist or not. There are no pieces of data accompanying them. The PowerShell switch data-type suits this purpose:

Continue reading

Author's picture

Sina Iravanian

Movie music junkie, insomniac, daydreamer, procrastinator, hard-determinist, introvert, and a bit into software.

Software Developer

Melbourne, Australia