Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.37k stars 4.79k forks source link

[BUG] ShareDirectoryClient.GetFileClient() doesn't support trailing dot in Windows Powershell 5 session #46749

Open yifanz7 opened 2 hours ago

yifanz7 commented 2 hours ago

Library name and version

Azure.Storage.Files.Shares 12.16.0

Describe the bug

In PSH 7 window or PowerShell ISE, ShareDirectoryClient.GetFileClient() supports trailing dot. When the file path input has trailing dots, the Uri returned by the method has the trailing dots. For example, in PSH 7:

Image

However, in PowerShell 5, the trailing dots are removed when calling GetFileClient on a ShareDirectoryClient:

Image

Expected behavior

In PowerShell 5, trailing dots should also be supported. When the path taken by GetFileClient has trailing dots, the Uri returned by the method should contain the trailing dots.

Actual behavior

In PowerShell 5, trailing dots are removed when calling GetFileClient(). However, in PowerShell 7, trailing dots are supported and the Uri returned contains the trailing dots as expected.

Reproduction Steps

  1. Get a ShareDirectoryClient
  2. Call GetFileClient method with a file path with trailing dots, like "filename1..."

Environment

No response

github-actions[bot] commented 2 hours ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.