Reputation: 5410
I am trying to run this from the PowerShell 3 ISE:
&"C:\inetpub\htpasswd.exe -bc C:\inetpub\wwwroot\xyz\password\passMD5.txt sm88555 sm88999"
but get this error:
is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
I think PowerShell stops evaluating this correctly after the first space?
Upvotes: 1
Views: 229
Reputation: 200293
The call operator doesn't interpret entire commandlines/expressions. That is what Invoke-Expression
is for. Separate the arguments from the command (and from each other) if you want to use the call operator:
& "C:\inetpub\htpasswd.exe" -bc "C:\inetpub\wwwroot\xyz\password\passMD5.txt" "sm88555" "sm88999"
Upvotes: 2