powershell - 在脚本的 PowerShell 帮助中省略路径?
问题描述
当我调用Get-Help My-Script.ps1 -Full
时,我的脚本名称总是显示在脚本的完整路径前面。
这非常丑陋,并且分散了我在帮助文本中提供的真正重要信息的注意力。
是否有一个选项Get-Help
只显示脚本名称 - 没有路径 - 可能只在前面加上.\
?
编辑
这是一个 CmdLet 示例:
<#
.SYNOPSIS
Initializes installation specific configuration data.
.DESCRIPTION
Updates rows in the database table.
.PARAMETER DataRootPath
Root path of runtime data to be stored.
.PARAMETER WebApiBaseUrl
Base path of Web API.
#>
然后,我在 CmdLet 上请求帮助,我得到以下输出:
PS D:\Documents\Visual Studio-Projekte\Installation\2 - IIS Setup> get-help .\Configure-IIS.ps1 -Full
NAME
D:\Documents\Visual Studio-Projekte\Installation\2 - IIS Setup\Configure-IIS.ps1
SYNOPSIS
Initializes installation specific configuration data.
SYNTAX
D:\Documents\Visual Studio-Projekte\Installation\2 - IIS Setup\Configure-IIS.ps1 [<CommonParameters>]
DESCRIPTION
Updates rows in the database table.
PARAMETERS
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
RELATED LINKS
我宁愿得到这个(请注意 NAME 和 SYNTAX 部分的区别):
PS D:\Documents\Visual Studio-Projekte\Installation\2 - IIS Setup> get-help .\Configure-IIS.ps1 -Full
NAME
.\Configure-IIS.ps1
SYNOPSIS
Initializes installation specific configuration data.
SYNTAX
.\Configure-IIS.ps1 [<CommonParameters>]
DESCRIPTION
Updates rows in the database table.
PARAMETERS
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
RELATED LINKS
解决方案
推荐阅读
- ios - 如何更改 UIBezierPath() 图的 z 位置?
- node.js - 使用gulpfile时如何修复“任务'test'不在你的gulpfile中”错误
- javascript - 未捕获的类型错误:$.simpleTicker 不是函数
- html - 如何使用 CSS 设置平滑滚动的速度?
- excel - 如何编写一个可以组合不定长度的两列的函数
- ruby-on-rails - 如何使用 rails 和 ruby 修复 sqlite3 错误
- angular - 角路由器链接不导航
- angular - Angular rxjs Observables 找到第一个活着的服务器
- laravel - Laravel 邮件未从 Cron Job 发送
- javascript - 使用 MongoDB 调用 close 后 Node.js 再次连接