-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-By DesignThe reported behavior is by design.The reported behavior is by design.
Description
When cd is used, the actual current directory of the process is not changed. This means that plain BCL methods still see the old current directory.
This creates an inconsistency with other ways of executing commands:
- PowerShell cmdlets:
$pwdis honored - External commands:
$pwdis honored - .NET methods:
$pwdis not honored
Steps to reproduce
PS C:\Users\Andrea> cd C:\temp
PS C:\temp> echo example1 > example1.txt
PS C:\temp> [IO.File]::WriteAllText('example2.txt', 'example2')Expected behavior
C:\temp contains example1.txt and example2.txt.
Actual behavior
C:\temp only contains example1.txt. example2.txt is created in C:\Users\Andrea.
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.15063.0
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15063.0
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1Btw the same happens with PowerShell v6.0.0-alpha.17.
Metadata
Metadata
Assignees
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-By DesignThe reported behavior is by design.The reported behavior is by design.