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

Test-Path returns "True" when path doesn't exist #15388

Closed
MouseFortune opened this issue May 12, 2021 · 3 comments
Closed

Test-Path returns "True" when path doesn't exist #15388

MouseFortune opened this issue May 12, 2021 · 3 comments
Labels
Issue-Bug Issue has been identified as a bug in the product Resolution-No Activity Issue has had no activity for 6 months or more WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module

Comments

@MouseFortune
Copy link

MouseFortune commented May 12, 2021

Steps to reproduce

In a non elevated PS window test a path which you don't have access to (such as below).

Test-Path registry::HKEY_USERS\S-1-5-19\SOFTWARE\Microsoft\Office\16.0\Common\MailSettings

Performing the action in an elevated PS window will give you the expected value


## Expected behavior
Test-Path registry::HKEY_USERS\S-1-5-19\SOFTWARE\Microsoft\Office\16.0\Common\MailSettings
Returns: False
Key does not exist

Actual behavior

Test-Path registry::HKEY_USERS\S-1-5-19\SOFTWARE\Microsoft\Office\16.0\Common\MailSettings
Returns: True


## Environment data

<!-- provide the output of $PSVersionTable -->

Name                           Value
----                           -----
PSVersion                      5.1.19041.906
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.906
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

PS C:\Users\MouseFortune> Test-Path registry::HKEY_USERS\S-1-5-19\SOFTWARE\Microsoft\Office\16.0\Common\MailSettings
True

@MouseFortune MouseFortune added the Needs-Triage The issue is new and needs to be triaged by a work group. label May 12, 2021
@MouseFortune MouseFortune changed the title Test-Path provides "True" when path doesn't exist Test-Path returns "True" when path doesn't exist May 12, 2021
@daxian-dbw daxian-dbw added Issue-Bug Issue has been identified as a bug in the product WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module and removed Needs-Triage The issue is new and needs to be triaged by a work group. labels May 12, 2021
Copy link
Contributor

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

1 similar comment
Copy link
Contributor

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

@microsoft-github-policy-service microsoft-github-policy-service bot added Resolution-No Activity Issue has had no activity for 6 months or more labels Nov 16, 2023
Copy link
Contributor

This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Issue has been identified as a bug in the product Resolution-No Activity Issue has had no activity for 6 months or more WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module
Projects
None yet
Development

No branches or pull requests

2 participants