public void CanDotSourcePath(string rawFileName) { string fullPath = Path.Combine(ScriptAssetPath, rawFileName); string quotedPath = PowerShellContextService.QuoteEscapeString(fullPath); var psCommand = new System.Management.Automation.PSCommand().AddScript($". {quotedPath}"); using (var pwsh = System.Management.Automation.PowerShell.Create()) { pwsh.Commands = psCommand; pwsh.Invoke(); } }
public void CorrectlyQuoteEscapesPaths(string unquotedPath, string expectedQuotedPath) { string extensionQuotedPath = PowerShellContextService.QuoteEscapeString(unquotedPath); Assert.Equal(expectedQuotedPath, extensionQuotedPath); }