How to get directory of the dib file in a Polyglot notebook?

109 views Asked by At

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

0

There are 0 answers