vors / jupyter-powershell

PowerShell language kernel for Jupyter
MIT License
132 stars 26 forks source link

Persistence Variable in upcoming cells #19

Closed dilshaat closed 4 years ago

dilshaat commented 4 years ago

It seems that the Variable created in one cell does not persist in next cells. For example:

$date = Get-Date
$date   \# returns nothing

Is this feature possible to add?

theaquamarine commented 4 years ago

The issue is https://github.com/vors/jupyter-powershell/blob/9417d40b9541d4e0c690f936f62bd7f3a117f721/powershell_kernel/kernel.py#L58 using the call operator, which runs in a child scope. Switching to the dot source operator fixes this, though might cause other issues, depending what else shares that scope.

self.proxy.send_input('. { ' + code + ' }')
ambrose-leung commented 4 years ago

Can whoever has permissions push the latest code so that it works with pip install powershell_kernel?

I had to do this manually. i.e. replace the files in Anaconda3\Lib\site-packages\powershell_kernel and then run python -m powershell_kernel.install

vors commented 4 years ago

@chlafreniere can you make a 0.1.1 release with this fix?

chlafreniere commented 4 years ago

Of course. Let me get started on it 😄