GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — $PWD, at launch from taskbar, should default to $home on Windows · Issue #8144 · PowerShell/PowerShell

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

New issue
Copy link
New issue
Copy link
Closed
#8079
Closed
$PWD, at launch from taskbar, should default to $home on Windows#8144
#8079
Copy link
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.

Description

@HemantMahawar
Hemant Mahawar (HemantMahawar)
opened on Oct 29, 2018
Issue body actions

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

Activity

  1. HemantMahawar commented on Oct 29, 2018

    @HemantMahawar
    Hemant Mahawar (HemantMahawar)
    on Oct 29, 2018
    ContributorAuthor
    More actions

    Steve Lee (@SteveL-MSFT) while you are working on #8079, maybe look at this as well ;)

  2. vexx32 commented on Oct 29, 2018

    @vexx32
    Rain Sallow (/u/ta11ow) (vexx32)
    on Oct 29, 2018
    Collaborator
    More actions

    I don't think it can be fixed in both cases.

    If we process profile before applying working directory, per Steve Lee (@SteveL-MSFT)'s PR, we cannot also give the profile script access to the about-to-be-set working directory via $pwd.

    If we retain current behaviour, where profile script is processed after, a Set-Location call in the profile script will unilaterally override anything set on the shortcut.

  3. SteveL-MSFT commented on Oct 29, 2018

    @SteveL-MSFT
    Steve Lee (SteveL-MSFT)
    on Oct 29, 2018
    Member
    More actions

    I tested against #8079 and the $profile.CurrentUserAllHosts starts in $HOME

    Reacted by Hemant Mahawar
  4. Aditya Patwardhan (adityapatwardhan)
    closed this as completedin #8079on Oct 29, 2018
  5. Ilya (iSazonov)
    added
    Resolution-FixedThe issue is fixed.The issue is fixed.
    on Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-FixedThe issue is fixed.The issue is fixed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.