Show file name in Invoke-WebRequest -OutFile -Verbose (#24041)

This commit is contained in:
jshigetomi
2024-07-17 08:00:42 +05:00
committed by GitHub
parent c107c9c66b
commit 666fdb5d5a
@@ -63,7 +63,7 @@ namespace Microsoft.PowerShell.Commands
{
string outFilePath = WebResponseHelper.GetOutFilePath(response, _qualifiedOutFile);
WriteVerbose(string.Create(System.Globalization.CultureInfo.InvariantCulture, $"File Name: {Path.GetFileName(_qualifiedOutFile)}"));
WriteVerbose(string.Create(System.Globalization.CultureInfo.InvariantCulture, $"File Name: {Path.GetFileName(outFilePath)}"));
// ContentLength is always the partial length, while ContentRange is the full length
// Without Request.Range set, ContentRange is null and partial length (ContentLength) equals to full length