If you first want to add-pssnapin Registerv2.0 and then call New-Token , you must link them one at a time, for example:
-command "add-pssnapin Registerv2.0; New-Token"
If New-Token expects a parameter, you should pass it directly on the command line, instead of trying to simulate user input.
For example, New-Item will expect a list of paths and type as input, both can also be provided on the command line as parameters. For instance:
New-Item foo -type directory
So, how you pass the value of www.google.com to New-Token depends on the parameter name. But it might look like this:
-command "add-pssnapin Registerv2.0; New-Token -tokenName www.google.com"
source share