Go through the current Host's UI object to prompt the user for a credential like so:
PSCredential cred = this.Host.UI.PromptForCredential("Enter username/password",
"", "", "");
However, if you are creating a cmdlet and go this route rather than creating a Credential parameter then the user will not be able to supply credentials in an automated fashion (ie through an argument to the Credential parameter).
BTW if your program knows the credentials and you don't want to prompt the end user then you can create a new PSCredential directly e.g.:
var password = new SecureString();
Array.ForEach("opensesame".ToCharArray(), password.AppendChar);
var cred = new PSCredential("john", password);
However I wouldn't hardcode the password in the EXE. I would use DPAPI or something like that.