Console Class

MSBuild Extension Pack

Console Class MSBuild Extension Pack Help 4.0.12.0
Valid TaskActions are:

Beep (Optional: Title, Repeat, Duration, Frequency, Interval)

ReadLine (Optional: Title, UserPrompt, ToLower, ToUpper Output: UserResponse)

Remote Execution Support: No

Inheritance Hierarchy

SystemObject  Microsoft.Build.UtilitiesTask
    MSBuild.ExtensionPackBaseTask
      MSBuild.ExtensionPack.UIConsole

Namespace: MSBuild.ExtensionPack.UI
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0

The Console type exposes the following members.

Constructors

  NameDescription
Public methodConsole
Top
Properties

  NameDescription
Public propertyDuration
Sets the duration. Default is 333ms. Value must be between 1 and 10000
Public propertyFrequency
Sets the frequency. Default is 600hz. Value must be between 37 and 32767
Public propertyInterval
Sets the interval between beebs. Default is 10ms. Value must be between 10 and 5000
Public propertyRepeat
Sets the repeat. Default is 1. Value must be between 1 and 20
Public propertyTitle
Set the title of the console
Public propertyToLower
Sets the UserResponse to lower text
Public propertyToUpper
Sets the UserResponse to uppper text
Public propertyUserPrompt
The message to prompt the user for input. Default is "Please enter a response and press [Enter]:"
Public propertyUserResponse
Gets the response that the user typed
Top
Examples

<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath>
        <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
    </PropertyGroup>
    <Import Project="$(TPath)"/>
    <Target Name="Default">
        <!-- Read input from the user -->
        <MSBuild.ExtensionPack.UI.Console TaskAction="ReadLine">
            <Output TaskParameter="UserResponse" PropertyName="Line"/>
        </MSBuild.ExtensionPack.UI.Console>
        <Message Text="User Typed: $(Line)"/>
         <!-- Read input from the user and uppercase it all -->
        <MSBuild.ExtensionPack.UI.Console TaskAction="ReadLine" UserPrompt="Please enter your password and press the [Enter] key" ToUpper="true">
            <Output TaskParameter="UserResponse" PropertyName="Line"/>
        </MSBuild.ExtensionPack.UI.Console>
        <Message Text="User Typed: $(Line)"/>
        <!-- Play some beeps -->
        <MSBuild.ExtensionPack.UI.Console TaskAction="Beep" Repeat="3"/>
        <MSBuild.ExtensionPack.UI.Console TaskAction="Beep" Repeat="4" Duration="500" Frequency="1000"/>
        <MSBuild.ExtensionPack.UI.Console TaskAction="Beep" Repeat="3" Interval="2000"/>
    </Target>
</Project>
See Also

Reference