I am very new to ps1 scripting (first day). Trying something very simple, trying to make sure that a file name is passed when script is executed and if not display a message to the user.
This doesn't appear to work.
param(
[Parameter(ValueFormPipeLine)]
[ValidateNotNullorempty()]
$var1
)
Process
{
if ($var = " ")
{
Throw "You MUST supply a text file."
}
}
Thanks for the pointers in advance.