Get-PSScriptFileInfo
Returns the metadata for a script.
语法
Default (默认值)
Get-PSScriptFileInfo
[-Path] <String>
[<CommonParameters>]
说明
This cmdlet searches for a PowerShell script located on the machine and returns the script metadata information.
示例
Example 1
This example returns the metadata for the script MyScript.ps1
.
Get-PSScriptFileInfo -Path '.\Scripts\MyScript.ps1'
Name Version Author Description
---- ------- ------ -----------
MyScript 1.0.0.0 dev@microsoft.com This script is a test script for PowerShellGet…
参数
-Path
Specifies the path to the resource.
参数属性
类型: | String |
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | 0 |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
输入
None
输出
Microsoft.PowerShell.PSResourceGet.UtilClasses.PSScriptFileInfo
备注
The New-PSScriptFileInfo
and Update-PSScriptFileInfo
cmdlets place the #requires
statements
for required modules between the <#PSScriptInfo
and comment-based help blocks of the help file.
The Get-PSScriptFileInfo
expects #requires
statements to be placed somewhere before the
comment-based help block. Any #requires
statements placed after the comment-based help block are
ignored by Get-PSScriptFileInfo
and Publish-PSResource
.