Skip to content

$PWD, at launch from taskbar, should default to $home on Windows #8144

@HemantMahawar

Description

@HemantMahawar

Steps to reproduce

  • Set the content of $PROFILE.CurrentUserAllHosts (profile.ps1 under $home\Documents\PowerShell) to print $PWD (such as Write-Verbose -Message $pwd -Verbose)
  • Launch PWSH or PWSH-Preview from taskbar icon
  • Does NOT repro if starting PWSH or PWSH-Preview using full path

Note: The shortcut Target property is set to "C:\Program Files\PowerShell\6 (or 6-preview)\pwsh.exe" -WorkingDirectory ~

Expected behavior

  • It should list user's $home as the current working directory

Actual behavior

  • It produces VERBOSE: C:\WINDOWS\system32 as the output

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.1.0 or 6.2.0-preview.1
PSEdition                      Core
GitCommitId                    6.1.0 or 6.2.0-preview.1
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions