Пример #1
0
        private static string GetLocation(this SessionState cmdletSession)
        {
            var psObjects = cmdletSession.Execute("Get-Location");
            var pathInfo  = (PathInfo)psObjects.Single().BaseObject;

            return(pathInfo.Path);
        }
Пример #2
0
 private static void Import(this SessionState cmdletSession, string profile)
 {
     if (!string.IsNullOrWhiteSpace(profile) && File.Exists(profile))
     {
         cmdletSession.Execute($"& '{profile}'");
     }
 }
Пример #3
0
 private static void SetLocation(this SessionState cmdletSession, string location)
 {
     cmdletSession.Execute($"Set-Location {location}");
 }