Skip to content

Commit 27b5cbb

Browse files
committed
1.1.8
1 parent cfe6319 commit 27b5cbb

File tree

6 files changed

+46
-9
lines changed

6 files changed

+46
-9
lines changed

sample/PSWebApi.OwinSample/PSWebApi.OwinSample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
<WarningLevel>4</WarningLevel>
4141
</PropertyGroup>
4242
<ItemGroup>
43-
<Reference Include="DataBooster.PSWebApi, Version=1.1.7.0, Culture=neutral, PublicKeyToken=ee1eb06d9feeb8dc, processorArchitecture=MSIL">
44-
<HintPath>..\..\packages\DataBooster.PSWebApi.1.1.7-beta\lib\net45\DataBooster.PSWebApi.dll</HintPath>
43+
<Reference Include="DataBooster.PSWebApi, Version=1.1.8.0, Culture=neutral, PublicKeyToken=ee1eb06d9feeb8dc, processorArchitecture=MSIL">
44+
<HintPath>..\..\packages\DataBooster.PSWebApi.1.1.8\lib\net45\DataBooster.PSWebApi.dll</HintPath>
4545
<Private>True</Private>
4646
</Reference>
4747
<Reference Include="Microsoft.CSharp" />

sample/PSWebApi.OwinSample/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
//
3232
// You can specify all the values or you can default the Revision and Build Numbers
3333
// by using the '*' as shown below:
34-
[assembly: AssemblyVersion("1.1.7.0")]
35-
[assembly: AssemblyFileVersion("1.1.7.0")]
34+
[assembly: AssemblyVersion("1.1.8.0")]
35+
[assembly: AssemblyFileVersion("1.1.8.0")]

sample/PSWebApi.OwinSample/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="DataBooster.PSWebApi" version="1.1.7-beta" targetFramework="net45" />
3+
<package id="DataBooster.PSWebApi" version="1.1.8" targetFramework="net45" />
44
<package id="Microsoft.AspNet.Cors" version="5.2.3" targetFramework="net45" />
55
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" />
66
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" />

src/DataBooster.PSWebApi/PSControllerExtensions.async.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ namespace DataBooster.PSWebApi
1717
public static partial class PSControllerExtensions
1818
{
1919
/// <summary>
20-
/// Asynchronously invokes the PowerShell script by using the supplied input parameters.
20+
/// Asynchronously invokes a PowerShell script by using the supplied input parameters.
2121
/// </summary>
2222
/// <param name="apiController">The ApiController. This is an extension method to ApiController, when you use instance method syntax to call this method, omit this parameter.</param>
2323
/// <param name="scriptPath">The fully qualified location of the PowerShell script to be run.</param>
2424
/// <param name="parameters">A set of parameters to the PowerShell script. The parameter names and values are taken from the keys and values of a collection.</param>
25-
/// <param name="cancellationToken"></param>
26-
/// <returns></returns>
25+
/// <param name="cancellationToken">The cancellation token can be used to request that the operation be abandoned before completing the execution. Exceptions will be reported via the returned Task object.</param>
26+
/// <returns>A task representing the asynchronous operation.</returns>
2727
public async static Task<HttpResponseMessage> InvokePowerShellAsync(this ApiController apiController, string scriptPath, IEnumerable<KeyValuePair<string, object>> parameters, CancellationToken cancellationToken)
2828
{
2929
PSContentNegotiator contentNegotiator = new PSContentNegotiator(apiController.Request);
@@ -76,6 +76,14 @@ private static Task<IList<PSObject>> InvokeAsync(this PowerShell ps, Cancellatio
7676
return task;
7777
}
7878

79+
/// <summary>
80+
/// Asynchronously invokes a Windows batch file or executable file by using a set of command-line arguments.
81+
/// </summary>
82+
/// <param name="apiController">The ApiController. This is an extension method to ApiController, when you use instance method syntax to call this method, omit this parameter.</param>
83+
/// <param name="scriptPath">The fully qualified location of an application file (batch file or executable file) to be executed.</param>
84+
/// <param name="arguments">Command-line arguments to pass when starting the process.</param>
85+
/// <param name="cancellationToken">The cancellation token can be used to request that the operation be abandoned before completing the execution. Exceptions will be reported via the returned Task object.</param>
86+
/// <returns>A task representing the asynchronous operation.</returns>
7987
public static async Task<HttpResponseMessage> InvokeCmdAsync(this ApiController apiController, string scriptPath, string arguments, CancellationToken cancellationToken)
8088
{
8189
PSContentNegotiator contentNegotiator = new PSContentNegotiator(apiController.Request);

src/DataBooster.PSWebApi/PSControllerExtensions.cmd.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,53 @@ namespace DataBooster.PSWebApi
1414
{
1515
public static partial class PSControllerExtensions
1616
{
17+
/// <summary>
18+
/// Consolidates all the arguments from uri query string and HTTP POST body (if any), as a single string of Command-line arguments.
19+
/// </summary>
20+
/// <param name="request">The HTTP request where the uri query string part of arguments will be extracted from. This is an extension method to HttpRequestMessage, when you use instance method syntax to call this method, omit this parameter.</param>
21+
/// <param name="argsFromBody">A set of raw arguments from HTTP POST body.</param>
22+
/// <param name="funcQuoteArgument">A transform function to apply to each raw argument.</param>
23+
/// <returns>A single string of Command-line arguments.</returns>
1724
public static string BuildCmdArguments(this HttpRequestMessage request, IEnumerable<string> argsFromBody, Func<string, string> funcQuoteArgument)
1825
{
1926
CmdArgumentsBuilder argsBuilder = new CmdArgumentsBuilder();
2027
return argsBuilder.AddFromQueryString(request).Add(argsFromBody).ToString(funcQuoteArgument);
2128
}
2229

30+
/// <summary>
31+
/// Consolidates all the arguments from uri query string and HTTP POST body (if any), as a single string of Command-line arguments.
32+
/// </summary>
33+
/// <param name="request">The HTTP request where the uri query string part of arguments will be extracted from. This is an extension method to HttpRequestMessage, when you use instance method syntax to call this method, omit this parameter.</param>
34+
/// <param name="argsFromBody">A set of raw arguments from HTTP POST body.</param>
35+
/// <param name="funcQuoteArgument">A transform function to apply to each raw argument.</param>
36+
/// <returns>A single string of Command-line arguments.</returns>
2337
public static string BuildCmdArguments(this HttpRequestMessage request, IEnumerable<KeyValuePair<string, object>> argsFromBody, Func<string, string> funcQuoteArgument)
2438
{
2539
CmdArgumentsBuilder argsBuilder = new CmdArgumentsBuilder();
2640
return argsBuilder.AddFromQueryString(request).Add(argsFromBody).ToString(funcQuoteArgument);
2741
}
2842

43+
/// <summary>
44+
/// Consolidates all the arguments from uri query string and HTTP POST body (if any), as a single string of Command-line arguments.
45+
/// </summary>
46+
/// <param name="request">The HTTP request where the uri query string part of arguments will be extracted from. This is an extension method to HttpRequestMessage, when you use instance method syntax to call this method, omit this parameter.</param>
47+
/// <param name="argsFromBody">A set of raw arguments from HTTP POST body (JSON).</param>
48+
/// <param name="funcQuoteArgument">A transform function to apply to each raw argument.</param>
49+
/// <returns>A single string of Command-line arguments.</returns>
2950
public static string BuildCmdArguments(this HttpRequestMessage request, JToken argsFromBody, Func<string, string> funcQuoteArgument)
3051
{
3152
CmdArgumentsBuilder argsBuilder = new CmdArgumentsBuilder();
3253
return argsBuilder.AddFromQueryString(request).Add(argsFromBody).ToString(funcQuoteArgument);
3354
}
3455

56+
/// <summary>
57+
/// Synchronously invokes a Windows batch file or executable file by using a set of command-line arguments.
58+
/// </summary>
59+
/// <param name="apiController">The ApiController. This is an extension method to ApiController, when you use instance method syntax to call this method, omit this parameter.</param>
60+
/// <param name="scriptPath">The fully qualified location of an application file (batch file or executable file) to be executed.</param>
61+
/// <param name="arguments">Command-line arguments to pass when starting the process.</param>
62+
/// <param name="timeoutSeconds">The time in seconds to wait for the command to execute before terminating the attempt to execute a command and generating an error.</param>
63+
/// <returns>A complete HttpResponseMessage contains the standard output (stdout) if the application runs successfully, Otherwise, the standard error (stderr).</returns>
3564
public static HttpResponseMessage InvokeCmd(this ApiController apiController, string scriptPath, string arguments, int timeoutSeconds = Timeout.Infinite)
3665
{
3766
PSContentNegotiator contentNegotiator = new PSContentNegotiator(apiController.Request);

src/DataBooster.PSWebApi/PSControllerExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static PSControllerExtensions()
3434
}
3535

3636
/// <summary>
37-
/// Gathers input parameters from uri query string and concatenates with HTTP POST body.
37+
/// Gathers input parameters from uri query string and concatenates with JSON parameters from HTTP POST body.
3838
/// </summary>
3939
/// <param name="request">The HTTP request. This is an extension method to HttpRequestMessage, when you use instance method syntax to call this method, omit this parameter.</param>
4040
/// <param name="parametersFromBody">The parameters read from body.</param>

0 commit comments

Comments
 (0)