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 — Move processing of `-WorkingDirectory` before processing of profiles for pwsh.exe by SteveL-MSFT · Pull Request #8079 · PowerShell/PowerShell

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Oct 19, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

PR Summary

Without this change, the processing of -WorkingDirectory happens after processing $PROFILE (all the profiles). This means that any $PROFILE that explicitly uses Set-Location to a desired folder will be ovewritten by -WorkingDirectory ~ which is added to the shortcut for pwsh by default.

The fix is to move the processing of -WorkingDirectory before processing of profiles. Note that this is a breaking change for any $PROFILE that expects to start in $PSHOME instead of ~ but it seems unlikely.

Fix #7895
Fix #8144

PR Checklist

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Change is not breaking
  • Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
  • This PR is ready to merge and is not Work in Progress.
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready.
  • User-facing changes
    • Not Applicable
    • OR
    • User-facing Documentation needed
      • Issue filed - Issue link:
  • Testing - New and feature
    • Not Applicable or can only be tested interactively
    • OR
    • Make sure you've added a new test if existing tests do not effectively test the code changed
      • Add [feature] if the change is significant or affects feature tests

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@SteveL-MSFT Steve Lee (SteveL-MSFT) added Review - Committee The PR/Issue needs a review from the PowerShell Committee Breaking-Change breaking change that may affect users labels Oct 19, 2018
@SteveL-MSFT Steve Lee (SteveL-MSFT) assigned Aditya Patwardhan (adityapatwardhan) Oct 19, 2018
@SteveL-MSFT
Steve Lee (SteveL-MSFT) requested review from Aditya Patwardhan (adityapatwardhan) and Andrew (anmenaga) October 19, 2018 01:14
@SteveL-MSFT
Steve Lee (SteveL-MSFT) requested a review from Dongbo Wang (daxian-dbw) as a code owner October 19, 2018 01:14
@SteveL-MSFT
move processing of -WorkingDirectory before processing of profiles
b51af84
@SteveL-MSFT
Steve Lee (SteveL-MSFT) force-pushed the console-working-dir branch from 50b5a96 to b51af84 Compare October 19, 2018 01:36
bergmeister
Christoph Bergmeister (bergmeister) approved these changes Oct 19, 2018
View reviewed changes

@bergmeister Christoph Bergmeister (bergmeister) left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I tested it and it works well. Thanks :-)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@SteveL-MSFT Steve Lee (SteveL-MSFT) added Committee-Reviewed PS-Committee has reviewed this and made a decision and removed Review - Committee The PR/Issue needs a review from the PowerShell Committee labels Oct 24, 2018
@SteveL-MSFT

Steve Lee (SteveL-MSFT) commented Oct 24, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

@PowerShell/powershell-committee reviewed this and agree with the change

bergmeister reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

anmenaga
Andrew (anmenaga) approved these changes Oct 25, 2018
View reviewed changes

@anmenaga Andrew (anmenaga) left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@HemantMahawar Hemant Mahawar (HemantMahawar) mentioned this pull request Oct 29, 2018
$PWD, at launch from taskbar, should default to $home on Windows #8144
Closed
adityapatwardhan
Aditya Patwardhan (adityapatwardhan) approved these changes Oct 29, 2018
View reviewed changes
@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit b1e2745 into PowerShell:master Oct 29, 2018
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the console-working-dir branch March 10, 2020 21:01
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
@SteveL-MSFT @adityapatwardhan
move processing of -WorkingDirectory before processing of profiles (P…
404a278
…owerShell#8079)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adityapatwardhan Aditya Patwardhan (adityapatwardhan) adityapatwardhan approved these changes
@daxian-dbw Dongbo Wang (daxian-dbw) Awaiting requested review from daxian-dbw
+2 more reviewers
@bergmeister Christoph Bergmeister (bergmeister) bergmeister approved these changes
@anmenaga Andrew (anmenaga) anmenaga approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@adityapatwardhan Aditya Patwardhan (adityapatwardhan)

Labels

Breaking-Change breaking change that may affect users Committee-Reviewed PS-Committee has reviewed this and made a decision

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

$PWD, at launch from taskbar, should default to $home on Windows When using Workingdirectory parameter on pwsh, working directory gets set AFTER execution of $PROFILE script

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@SteveL-MSFT @bergmeister @anmenaga @adityapatwardhan
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — 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.