Skip to content
Snippets Groups Projects

Créer des alias powershell

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Gregory.Ooghe

    Pour créer en alias powershell il faut d'abord pouvoir exécuter des scripts sur son poste :
    Set-ExecutionPolicy RemoteSigned
    puis créer un profil powershell :
    New-Item -Type File -Force $PROFILE
    Pour accéder au profil :
    ise $PROFILE

    Pour trouver le chemin d'un exécutable (ici jupyter-notebook.exe) :
    where.exe jupyter-notebook
    Ensuite :
    New-Alias nom-de-l-alias "C:\Path-to-executable"

    Edited
    profile.ps1 344 B
    # Création d'un fonction qui nous place dans le répertoire des notebooks et lance jupyter notebook
    function Start-JupyterNotebook
    { & cd 'C:\Users\gregory.ooghe\Documents\Travail\001_Outils\jupyter\' 
    C:\Users\gregory.ooghe\AppData\Local\Programs\Python\Python310\Scripts\jupyter-notebook.exe
    }
    New-Alias -Name jn -Value Start-JupyterNotebook
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment