Get-PSScriptFileInfo
Returns the metadata for a script.
Syntax
Default (Default)
Get-PSScriptFileInfo
[-Path] <String>
[<CommonParameters>]
Description
This cmdlet searches for a PowerShell script located on the machine and returns the script metadata information.
Examples
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…
Parameters
-Path
Specifies the path to the resource.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 0 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | 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.
Inputs
None
Outputs
Microsoft.PowerShell.PSResourceGet.UtilClasses.PSScriptFileInfo
Notes
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.