0

When using Polyglot notebooks (previously known as dot net interactive notebooks) with PowerShell, how do I get the directory of the executing file in this ecosystem?

In (raw) PowerShell I would use $PSScriptRoot (or $MyInvocation.MyCommand.Path), is there an equivalent in Polyglot notebooks?

I am currently storing it like this for later use, but I'd bet there is a more idiomatic way of doing it in notebooks.

$currentDirectory = Get-Location

Alex KeySmith
  • 16,657
  • 11
  • 74
  • 152

0 Answers0