Skip to content

Commit

Permalink
change powershell.execute to run file in PSIC
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerLeonhardt committed Jul 16, 2019
1 parent e6d4763 commit 5e144da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions src/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,15 @@ function startREPLProc(context: ExtensionContext, config: settings.ISettings, pw
let filePath = fileURLToPath(document.uri)
proc.log.appendLine(`executing: ${filePath}`)

let term = await workspace.createTerminal({
name: `PowerShell: ${filePath}`,
shellPath: pwshPath,
shellArgs: ['-NoProfile', filePath].concat(argStrs)
})

// switch to the terminal and steal focus
term.show(false)
// Escape single quotes by adding a second single quote.
if(filePath.indexOf('\'') !== -1) {
filePath = filePath.replace(/'/, '\'\'')
}

const evaluateArgs: IEvaluateRequestArguments = {
expression: `& '${filePath}'`,
}
client.sendRequest(EvaluateRequestMessage, evaluateArgs)
})

// Push the disposable to the context's subscriptions so that the
Expand Down

0 comments on commit 5e144da

Please sign in to comment.