﻿using System.Management.Automation;

namespace PoshGit2
{
    class PSCurrentWorkingDirectory : ICurrentWorkingDirectory
    {
        private SessionState _sessionState;

        public PSCurrentWorkingDirectory(SessionState sessionState)
        {
            _sessionState = sessionState;
        }

        public string CWD
        {
            get
            {
                return _sessionState.Path.CurrentFileSystemLocation.Path;
            }
        }
    }
}
﻿using System.Management.Automation;

namespace PoshGit2
{
    class PSCurrentWorkingDirectory : ICurrentWorkingDirectory
    {
        private SessionState _sessionState;

        public PSCurrentWorkingDirectory(SessionState sessionState)
        {
            _sessionState = sessionState;
        }

        public string CWD
        {
            get
            {
                return _sessionState.Path.CurrentLocation.ProviderPath;
            }
        }
    }
}
Use CurrentLocation.ProviderPath to get actual file system path
Use CurrentLocation.ProviderPath to get actual file system path
