Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive: "is implicitly aliasing 'Get-..\..\Target.ps1'" on file path? #1369

Closed
ili101 opened this issue Nov 12, 2019 · 6 comments · Fixed by #1386
Closed

False positive: "is implicitly aliasing 'Get-..\..\Target.ps1'" on file path? #1369

ili101 opened this issue Nov 12, 2019 · 6 comments · Fixed by #1386

Comments

@ili101
Copy link

ili101 commented Nov 12, 2019

Steps to reproduce

image
Create file/folder structure as how in the image:

  1. create "test" folder.
  2. create "Target.ps1" in it (can be empty).
  3. create file in 2 sub folders ".\sub\sub2\test.ps1" with & ..\..\Target.ps1
  4. open "test" folder in VSCode (if it already open then F1 > "Reload Window"

get false positive:

{
	"resource": "/c:/temp/sub/sub2/test.ps1",
	"owner": "_generated_diagnostic_collection_name_#3",
	"code": "PSAvoidUsingCmdletAliases",
	"severity": 4,
	"message": "'..\\..\\Target.ps1' is implicitly aliasing 'Get-..\\..\\Target.ps1' because it is missing the 'Get-' prefix. This can introduce possible problems and make scripts hard to maintain. Please consider changing command to its full name.",
	"source": "PSScriptAnalyzer",
	"startLineNumber": 1,
	"startColumn": 3,
	"endLineNumber": 1,
	"endColumn": 19
}

Environment data

PS C:\temp> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.0.0-preview.5
PSEdition                      Core
GitCommitId                    7.0.0-preview.5
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}       
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS C:\temp> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
1.18.3
1.18.1      
1.18.0      
@bergmeister
Copy link
Collaborator

bergmeister commented Jan 2, 2020

Thanks for the reminder in the other issue. I can confirm this is still happening unfortunately. I though I fixed that as part of a similar bug last year (PR #1216).
Because it only happens in VS-Code when the test folder is the root folder, I am very sure it is due to some rogue entries getting into the PSSA cache, aka a scenario that unfortunately only happens within in the VS-Code integrated terminal of PSES, we should try to find a fix for this nevertheless, it just makes it harder to debug unfortunately

@ili101
Copy link
Author

ili101 commented Apr 16, 2020

Hi, don't know if it was fixed and re broken or if the fix did not work but in the last version of the VSCode extension (v2020.4.2-preview) the bug still exist.
Can you please reopen this issue and give this another look?

@bergmeister
Copy link
Collaborator

bergmeister commented Apr 16, 2020

@ili101 It is pending release of PSSA 1.19.0, that is currently being worked on

@ili101
Copy link
Author

ili101 commented Apr 16, 2020

@bergmeister When the next version is planed to come out (general time scale)? Thank you

@bergmeister
Copy link
Collaborator

bergmeister commented Apr 16, 2020

@ili101 1.19.0 What we currently have in master is already feature complete for that. We are currently working on getting the signing in the release build to work again, so PR #1442 is going to be the last PR apart from one for the change log. We plan to offer the built and signed version to users for early testing hopefully this month and release next month. If things go well, it could happen faster.
If you already want to test-drive it yourself, please find a local (unsigned) build below that you could install manually
PSScriptAnalyzer.zip

@bergmeister
Copy link
Collaborator

@ili101 You can test-drive PSSA already from here as we've published the release candidate already to the PoshTestGallery. Pending no blocking issues, we will release this version next week to the PSGallery as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants