Creating Alias to `man` with arguments -online?

前端 未结 2 1370
清酒与你
清酒与你 2021-01-13 21:36

I want to create an alias for Get-Help [foo] -online. But I can\'t get arguments to work.

I tried a few things including Set-Alias -Name mano -Val

相关标签:
2条回答
  • 2021-01-13 22:32

    You can't create an alias with arguments like that.

    You can use a function though. Something like...

    PS> function mano { Get-Help $args[0] -online }
    

    If you want this to be available every time you start ps, then you can put it in your profile. see $profile.

    0 讨论(0)
  • 2021-01-13 22:37

    If you have Powershell v3

    $PSDefaultParameterValues = @{
        "Get-Help:Online" = {$True}
    }
    
    0 讨论(0)
提交回复
热议问题