Alias syntax for Firefox 'cfx run -profile <dir>'

∥☆過路亽.° 提交于 2019-11-29 17:39:40

In PowerShell aliases can be defined only for commands or cmdlets, not for entire commandlines with parameters:

NAME
    New-Alias

SYNOPSIS
    Creates a new alias.
[...]
DESCRIPTION
    The New-Alias cmdlet creates a new alias in the current Windows
    PowerShell session. Aliases created by using New-Alias are not
    saved after you exit the session or close Windows PowerShell. You
    can use the Export-Alias cmdlet to save your alias information to
    a file. You can later use Import-Alias to retrieve that saved
    alias information.

PARAMETERS
[...]
    -Value <String>
        Specifies the name of the cmdlet or command element that is
        being aliased.

You'll need a custom function if you want a shorthand for running a particular command with parameters.

function cfxp {
  & cfx run -p "$env:APPDATA\Mozilla\Firefox\Profiles\ripltbxm.cfxp"
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!