Hi,
Just as a special note, you have to be careful what the content is of the variables you pass to PowerShell are.
Some characters will cause PowerShell to not parse the input properly, I have often found that to be a problem with complex passwords that use special characters.
Sometimes you can avoid this by wrapping the variables in single quotes, but not always.
Hope this helps,
Ian