Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Set-Location breaks $PWD #9293

Copy link
Copy link
@morsley

Description

@morsley
Issue body actions

Steps to reproduce

Steps documented below. $PWD.Path populates, but other members break (returning $null). This behavior does not happen by using Set-Location without piping.

Expected behavior

$ > Set-Location -Path C:\
$ > $PWD.Drive

Name           Used (GB)     Free (GB) Provider      Root
----           ---------     --------- --------      ----
C                  50.00        100.00 FileSystem    C:\

$ > Get-Item -Path C:\Windows | Set-Location
$ > $PWD.Drive

Name           Used (GB)     Free (GB) Provider      Root
----           ---------     --------- --------      ----
C                  50.00        100.00 FileSystem    C:\

$ >

Actual behavior

$ > Set-Location -Path C:\
$ > $PWD.Drive

Name           Used (GB)     Free (GB) Provider      Root
----           ---------     --------- --------      ----
C                  50.00        100.00 FileSystem    C:\

$ > Get-Item -Path C:\Windows | Set-Location
$ > $PWD.Drive
$ >

Environment data

Name                           Value
----                           -----
PSVersion                      6.2.0
PSEdition                      Core
GitCommitId                    6.2.0
OS                             Microsoft Windows 6.1.7601 S
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-FileSystem-Providerspecific to the FileSystem providerspecific to the FileSystem providerIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.