String does not match the pattern of "^PowerShell@2$".
See original GitHub issueWe have the following task in azure-pipelines.yaml
file.
- task: PublishBuildArtifacts@1
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
displayName: 'Publish Build Artifacts'
The below false positive error will be shown on the PublishBuildArtifacts@1
line.
Publish build artifacts to Azure Pipelines or a Windows file share
String does not match the pattern of "^PowerShell@2$".
Peek Problem (Alt+F8)
No quick fixes available
See related issue.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Azure Pipelines VSTest@2 task fails Intellisense validation ...
Azure Pipelines VSTest@2 task fails Intellisense validation with 'String does not match the pattern of "^@PowerShell@2$". - Visual Studio Feedback.
Read more >Powershell Select-String -pattern -notMatch - Stack Overflow
Currently I'm stuck with code that use only one -notMatch. And I can't use -Match because there could be 2+ users in the...
Read more >Select-String - PowerShell - Microsoft Learn
Select-String uses the Pattern parameter to specify HELLO. The CaseSensitive parameter specifies that the case must match only the upper-case pattern.
Read more >about Comparison Operators - PowerShell | Microsoft Learn
Long description · -like , -ilike , -clike - string matches wildcard pattern · -notlike , -inotlike , -cnotlike - string does not...
Read more >Where-Object (Microsoft.PowerShell.Core)
Starting in Windows PowerShell 3.0, there are two different ways to ... if the property value does not match a value that includes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sheeeng As for Azure Pipelines it is better to use https://marketplace.visualstudio.com/items?itemName=ms-azure-devops.azure-pipelines as it has build in language server specific for
azure-pipelines.yaml
and that server has support ofignoreCase
fields.@JPinkney @gorkem I done investigation around this issue, the problem in schema itself, it is used
ignoreCase
field for some object fields. I cannot find any mentions ofignoreCase
in JSON Schema spec, across schema it has different values, likekey
,all
,value
. json-language-server also doesn’t have support of this:Schema used for that JSON is https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json As you can see it has exactly the same error.
And error happened because object with
PublishBuildArtifacts@1
defined as:So next yaml doesn’t have error:
Need to set
pathToPublish
->PathtoPublish
andartifactName
->ArtifactName
as their names defined in schema.In the end, I not sure that we need to implement support of
ignoreCase
, as it is not part of JSON Schema specification. WDYT?