Skip to content

windows: '~' Home reference bug  #20761

@yuanjs-0108

Description

@yuanjs-0108

Prerequisites

Steps to reproduce

when i update PowerShell in my windows 11 workstation version to 7.4.0 below is version
$ $PSVersionTable

Name Value


PSVersion 7.4.0
PSEdition Core
GitCommitId 7.4.0
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

when i use the ~ to refer my work home, that may conjunct with current path; at old version that method like resolve ~ to $HOME environment variation.
Hope can resolve this problem. thanks

Expected behavior

ps> more ~\test
1

Actual behavior

# xxxxxx @ SHC5CG33131WZL in ~\AppData\Local\Temp\tmphcnstt.tmp [18:41:39]
$ more ~\test
Cannot access file C:\Users\xxxxxx\AppData\Local\Temp\tmphcnstt.tmp\~\test

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.0
PSEdition                      Core
GitCommitId                    7.4.0
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-TriageThe issue is new and needs to be triaged by a work group.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions