Requires 2 args. If one args then I need an error.

by Nov 2, 2014


Big newbie and my question isn't for a class but for work.  This is my 3rd day at it and having difficulties.  Not looking for an answer but direction as I would like to learn PowerShell and Scripting.

Scope in a sense:  Need to create a small script that outputs exactly what the user inputs but only two strings.  If the user inputs two key codes of 2k#s and 3k#t out put would be the same (2k#s and 3k#t).   This is what I did to create:

param ( 




Write-host $args1,$args2

That was easy enough but I also want it to throw an error ("my script requires two codes") if the user only puts in one key code.
I've been playing with if else statements but with no luck.  Any sugestions or guidence would be great.  Again, I'm not looking for an answer just a point in the right direction.
Thanks for your help.