Skip to content

Conversation

@abatishchev
Copy link
Member

@abatishchev abatishchev commented Oct 29, 2022

The only place this localized string used is here:

# Validate pattern does not end with a \.
if ($pattern[$pattern.Length - 1] -eq [System.IO.Path]::DirectorySeparatorChar) {
throw (Get-LocString -Key PSLIB_InvalidPattern0 -ArgumentList $pattern)
}

In real world, the error looks like this

##[error]Invalid pattern: 'C:\__w\1\s\src\Application\pkg\Release\'

Which is too vague to make it possible to troubleshoot without finding and looking into the source code. I ran into this error here: microsoft/azure-pipelines-tasks#17106.

This PR includes:

  1. improving the error message.
  2. using EndsWith() instead of $str[$str,Legth -1] for readability

However, what doesn't include:

  1. I didn't rename the placeholder
  2. nor updated the localizations

Please let me know if I should do the former and what's the process for the latter (I can update the ru-ru string though).

@kirill-ivlev
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@abatishchev
Copy link
Member Author

Awesome, thanks everyone! Can someone who has the permissions to complete the PR?

@localconst localconst merged commit e05ff6f into microsoft:master Nov 1, 2022
@localconst
Copy link
Contributor

Done, thanks for the contribution!

@abatishchev abatishchev deleted the patch-1 branch November 1, 2022 21:37
fullstackinfo pushed a commit to fullstackinfo/azure-pipelines-task-lib that referenced this pull request Aug 17, 2024
* Updated PSLIB_InvalidPattern0 to be more readable

* Update LegacyFindFunctions.ps1

Co-authored-by: Kirill Ivlev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants