Thursday 15 July 2010

powershell - Invoking Read-Host cmdlet from within C# Custom Cmdlet -


I am writing a set of PowerShell CMDlets which require Oauth2 authentication. I am currently able to reach a point where a new browser window opens and the user has copied the access authentication code to go back to the CDdlets. However, this means that I have a separate CMDlet that now accepts the atode code as input.

Is there any way to invite reading-host? I have tried, but despite being listed, Microsoft does not seem to have it. PowerShell.Commands namespace, but something like that.

I have tried the console. Radlin (), but it has just been ignored when CMDlet is turned on.

ReadHostCommand is in Microsoft .PowerShell.Commands namespace But you have to refer to the Microsoft.PowerShell.Commands.Utility.dll assembly.

No comments:

Post a Comment