Skip to content

Commit bb8cb61

Browse files
authored
Log PowerShell Worker version on start (#330)
Log worker version on start
1 parent 1fda3f2 commit bb8cb61

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Worker.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
namespace Microsoft.Azure.Functions.PowerShellWorker
1616
{
17+
using LogLevel = Microsoft.Azure.WebJobs.Script.Grpc.Messages.RpcLog.Types.Level;
18+
1719
/// <summary>
1820
/// The PowerShell language worker for Azure Function
1921
/// </summary>
@@ -24,6 +26,10 @@ public static class Worker
2426
/// </summary>
2527
public async static Task Main(string[] args)
2628
{
29+
RpcLogger.WriteSystemLog(
30+
LogLevel.Information,
31+
string.Format(PowerShellWorkerStrings.PowerShellWorkerVersion, typeof(Worker).Assembly.GetName().Version));
32+
2733
WorkerArguments arguments = null;
2834
Parser.Default.ParseArguments<WorkerArguments>(args)
2935
.WithParsed(ops => arguments = ops)

src/resources/PowerShellWorkerStrings.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120+
<data name="PowerShellWorkerVersion" xml:space="preserve">
121+
<value>Azure Functions PowerShell Worker version [{0}]".</value>
122+
</data>
120123
<data name="RequireEntryPointForScriptModule" xml:space="preserve">
121124
<value>The 'entryPoint' property needs to be specified when 'scriptFile' points to a PowerShell module script file (.psm1).</value>
122125
</data>

0 commit comments

Comments
 (0)