Closed i5513 closed 2 months ago
Missing information
Seems like that, in Powershell 5.1, a filter ends in "?" it have a different behaviour?
Examples:
PS c:\> mkdir 11,11T | Out-Null ; gci . -Attributes "Directory" -Filter "??????" Directorio: C:\Users\XXXX\borrar Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 14/05/2024 8:15 11 d----- 14/05/2024 8:15 11T
C:\> rm -Force 1ddddd; mkdir 1ddddd | Out-Null ; gci . -Attributes "Directory" -Filter "1????d?????????????????????" Directorio: C:\Users\XXXX\borrar Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 14/05/2024 8:31 1ddddd
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_wildcards?view=powershell-7.4
https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/7.4/Microsoft.PowerShell.Core/About/about_Wildcards.md
@sdwheeler
ff488242-1650-b2fd-c3a7-bec7ec1a8ee6
For the filesystem, .NET matches ? to zero or one character in that position. For string comparisons, ? matches exactly one character in that position.
?
Type of issue
Missing information
Feedback
Seems like that, in Powershell 5.1, a filter ends in "?" it have a different behaviour?
Examples:
Page URL
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_wildcards?view=powershell-7.4
Content source URL
https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/7.4/Microsoft.PowerShell.Core/About/about_Wildcards.md
Author
@sdwheeler
Document Id
ff488242-1650-b2fd-c3a7-bec7ec1a8ee6