2

I want to create an alias for 'jupyter notebook' in windows powershell. I ran the following command:

Set-Alias -Name jup -Value jupyter notebook

It triggered following error:

Set-Alias : A positional parameter cannot be found that accepts argument 'notebook'.
At line:1 char:1
+ Set-Alias -Name jup -Value jupyter notebook
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 + CategoryInfo : InvalidArgument: (:) [Set-Alias], ParameterBindingException
 + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetAliasCommand

Can someone please help me fix it?

asked Feb 9, 2021 at 5:10
2
  • 1
    if "jupyter notebook" works from command prompt , then you should try Set-Alias -Name jup -Value "jupyter notebook" in quotes. Commented Feb 9, 2021 at 5:27
  • Does this answer your question? How can I write a PowerShell alias with arguments in the middle? Commented Feb 9, 2021 at 7:42

1 Answer 1

2

The problem comes from the fact that to start "jupyter notebook" you start the exe "jupyter" with parameter "notebook". To do so you have to create a function :

function jup {
 jupyter notebook
}

Then you can put this function in one of your profile files.

Sabuncu
5,3246 gold badges60 silver badges96 bronze badges
answered Feb 9, 2021 at 5:25
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.