From 9829fdc3225b33f12c3f05c9fae75d810b45c90e Mon Sep 17 00:00:00 2001 From: Anatoli Beliaev Date: Mon, 16 Sep 2019 16:53:42 -0700 Subject: [PATCH 1/2] Log worker version on start --- src/Worker.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Worker.cs b/src/Worker.cs index 75cd8051..ad6e7380 100644 --- a/src/Worker.cs +++ b/src/Worker.cs @@ -14,6 +14,8 @@ namespace Microsoft.Azure.Functions.PowerShellWorker { + using LogLevel = Microsoft.Azure.WebJobs.Script.Grpc.Messages.RpcLog.Types.Level; + /// /// The PowerShell language worker for Azure Function /// @@ -24,6 +26,10 @@ public static class Worker /// public async static Task Main(string[] args) { + RpcLogger.WriteSystemLog( + LogLevel.Information, + $"Azure Functions PowerShell Worker version [{typeof(Worker).Assembly.GetName().Version}]"); + WorkerArguments arguments = null; Parser.Default.ParseArguments(args) .WithParsed(ops => arguments = ops) From 8b0845a71f242d73e897e48993f7bace8ff7db7b Mon Sep 17 00:00:00 2001 From: Anatoli Beliaev Date: Tue, 17 Sep 2019 12:06:32 -0700 Subject: [PATCH 2/2] Move the message text to resources --- src/Worker.cs | 2 +- src/resources/PowerShellWorkerStrings.resx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Worker.cs b/src/Worker.cs index ad6e7380..df081af5 100644 --- a/src/Worker.cs +++ b/src/Worker.cs @@ -28,7 +28,7 @@ public async static Task Main(string[] args) { RpcLogger.WriteSystemLog( LogLevel.Information, - $"Azure Functions PowerShell Worker version [{typeof(Worker).Assembly.GetName().Version}]"); + string.Format(PowerShellWorkerStrings.PowerShellWorkerVersion, typeof(Worker).Assembly.GetName().Version)); WorkerArguments arguments = null; Parser.Default.ParseArguments(args) diff --git a/src/resources/PowerShellWorkerStrings.resx b/src/resources/PowerShellWorkerStrings.resx index 539ede03..acf645c9 100644 --- a/src/resources/PowerShellWorkerStrings.resx +++ b/src/resources/PowerShellWorkerStrings.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Azure Functions PowerShell Worker version [{0}]". + The 'entryPoint' property needs to be specified when 'scriptFile' points to a PowerShell module script file (.psm1).