Skip to content

Commit a3a8d44

Browse files
committed
Fixes an issue where Write-Debug doesn't log debug messages to CloudWatch for a Lambda PowerShell function.
1 parent e24c52f commit a3a8d44

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Libraries/src/Amazon.Lambda.PowerShellHost/Amazon.Lambda.PowerShellHost.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
77
<Description>AWS Lambda PowerShell Host.</Description>
88
<AssemblyTitle>Amazon.Lambda.PowerShellHost</AssemblyTitle>
9-
<VersionPrefix>3.0.0</VersionPrefix>
9+
<VersionPrefix>3.0.1</VersionPrefix>
1010
<AssemblyName>Amazon.Lambda.PowerShellHost</AssemblyName>
1111
<PackageId>Amazon.Lambda.PowerShellHost</PackageId>
1212
<PackageTags>AWS;Amazon;Lambda;PowerShell</PackageTags>

Libraries/src/Amazon.Lambda.PowerShellHost/PowerShellFunctionHost.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ private IAsyncResult BeginInvoke(string input, ILambdaContext context)
148148
// Clear all previous PowerShell executions, variables and outputs
149149
this._ps.Commands?.Clear();
150150
this._ps.Streams.Verbose?.Clear();
151+
this._ps.Streams.Debug?.Clear();
152+
this._ps.Streams.Information?.Clear();
153+
this._ps.Streams.Warning?.Clear();
151154
this._ps.Streams.Error?.Clear();
152155
this._ps.Runspace?.ResetRunspaceState();
153156
this._output.Clear();
@@ -292,6 +295,7 @@ private void SetupStreamHandlers()
292295
};
293296

294297
this._ps.Streams.Verbose.DataAdding += _loggerFactory("Verbose");
298+
this._ps.Streams.Debug.DataAdding += _loggerFactory("Debug");
295299
this._ps.Streams.Information.DataAdding += _loggerFactory("Information");
296300
this._ps.Streams.Warning.DataAdding += _loggerFactory("Warning");
297301
this._ps.Streams.Error.DataAdding += _loggerFactory("Error");

0 commit comments

Comments
 (0)