For my script I have some parameters like such:
[Alias("f")]
[string]$file
When the user enters this at command-line: "./script.ps1 -f"
It comes up with an error >"Missing an argument for parameter...." I would like to handle this error myself, the default error is technical, and messy.
I would like to make it user friendly and readable, anyway? Every suggestion I have read has said to make it Mandatory.
But it is NOT a mandatory command, what I am trying to accomplish is if someone provides the parameter tag (AKA "-file"), but fails to provide a value for it.