Skip to content

Commit

Permalink
Fixes an issue where Write-Debug doesn't log debug messages to CloudW…
Browse files Browse the repository at this point in the history
…atch for a Lambda PowerShell function.
  • Loading branch information
ashishdhingra committed Sep 19, 2024
1 parent e24c52f commit 9552969
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<Description>AWS Lambda PowerShell Host.</Description>
<AssemblyTitle>Amazon.Lambda.PowerShellHost</AssemblyTitle>
<VersionPrefix>3.0.0</VersionPrefix>
<VersionPrefix>3.0.1</VersionPrefix>
<AssemblyName>Amazon.Lambda.PowerShellHost</AssemblyName>
<PackageId>Amazon.Lambda.PowerShellHost</PackageId>
<PackageTags>AWS;Amazon;Lambda;PowerShell</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ private IAsyncResult BeginInvoke(string input, ILambdaContext context)
this._ps.Commands?.Clear();
this._ps.Streams.Verbose?.Clear();
this._ps.Streams.Error?.Clear();
this._ps.Streams.Debug?.Clear();
this._ps.Runspace?.ResetRunspaceState();
this._output.Clear();

Expand Down Expand Up @@ -295,6 +296,7 @@ private void SetupStreamHandlers()
this._ps.Streams.Information.DataAdding += _loggerFactory("Information");
this._ps.Streams.Warning.DataAdding += _loggerFactory("Warning");
this._ps.Streams.Error.DataAdding += _loggerFactory("Error");
this._ps.Streams.Debug.DataAdding += _loggerFactory("Debug");
}

private void LogMessage(string prefix, string message)
Expand Down

0 comments on commit 9552969

Please sign in to comment.