private static string GetLocation(this SessionState cmdletSession) { var psObjects = cmdletSession.Execute("Get-Location"); var pathInfo = (PathInfo)psObjects.Single().BaseObject; return(pathInfo.Path); }
private static void Import(this SessionState cmdletSession, string profile) { if (!string.IsNullOrWhiteSpace(profile) && File.Exists(profile)) { cmdletSession.Execute($"& '{profile}'"); } }
private static void SetLocation(this SessionState cmdletSession, string location) { cmdletSession.Execute($"Set-Location {location}"); }