Shawn's blog Shawn's blog
About Me
  • Category
  • Tag
  • Archive
GitHub (opens new window)

Shawn Jin

I am not a creator of knowledge, I am just a porter of knowledge.
About Me
  • Category
  • Tag
  • Archive
GitHub (opens new window)
  • Adding your own command to PowerShell

Shawn Jin
2019-03-31
studyingnotes

Adding your own command to PowerShell

# Adding your own command to PowerShell

# Step 1: Check the profile location

under PowerShell, type $PROFILE to get the location. It usually shows something like C:\Users\username\...\WindowsPowerShell\Microsoft.PowerShell_profile.ps1.

# Step 2: Edit that file to add your own command.

For example, you installed a software Typora and want to add command typora to open it. In the profile file, just add set-alias typora "{$YourSoftwareLocation}\Typora\Typora.exe". After that, you need to close and open PowerShell again. Then you can use typora to open Typora or even use it edit a file.

#powershell
Updated: 2021/09/09, 11:40:27
最近更新
01
Python import files from different directories
12-31
02
Classmethod in Python
09-15
03
Single/Double Star (/*) Parameters in Python
09-15
更多文章>
Theme by Vdoing | Copyright © 2019-2021 Shawn Jin | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式