Créer des alias powershell
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"
# 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
Please register or sign in to comment