/// <summary> /// Set working path from PowerShell host environment. /// </summary> /// <param name="executionContext">An $ExecutionContext object.</param> /// <remarks> /// Called from PowerShell. /// </remarks> public static void UseExecutionContext(EngineIntrinsics executionContext) { if (executionContext == null) { _GetWorkingPath = () => Directory.GetCurrentDirectory(); return; } _GetWorkingPath = () => executionContext.SessionState.Path.CurrentFileSystemLocation.Path; }
public Path(Uri uri, PathDelegate pd) { this.uri = uri; this.pd = pd; }