Make 'cd' go to the HOME directory

This commit is contained in:
Sergei Vorobev committed 2016-07-27 18:43:19 -07:00
1 parent aa72512c76
commit 06252836ea
2 files changed
+39 -18

No files matched your search

@@ -996,6 +996,12 @@ namespace Microsoft.PowerShell.Commands
try
{
// Change the current working directory
if (string.IsNullOrEmpty(Path))
{
// If user just typed 'cd', go to FileSystem provider home directory
Path = SessionState.Internal.GetSingleProvider(Commands.FileSystemProvider.ProviderName).Home;
}
result = SessionState.Path.SetLocation(Path, CmdletProviderContext);
}
catch (PSNotSupportedException notSupported)