You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is present in Windows PowerShell 5.1, and PowerShell 7*. When you've got a script file which has the PSCriptInfo comment block, usually added/updated with New-/Update-ScriptFileInfo, if you remove the blank line between this comment block and the next comment block where you include your usual keywords/sections, Test-ScriptFileInfo fails, and since both New-/Update-ScriptFileInfo use Test-ScriptFileInfo, they also fail.
Sample file that passes:
<#PSScriptInfo .VERSION 1.0.0 .GUID 60e7a6d6-791b-48b7-be15-6e6a793f9812 .AUTHOR Jeremy.Bradshaw@Outlook.com .TAGS Exchange Outlook EWS EWS Managed API Large Items Migration .LICENSEURI https://github.com/JeremyTBradshaw/PowerShell .PROJECTURI https://github.com/JeremyTBradshaw/PowerShell/blob/master/LICENSE .RELEASENOTES#><#.Synopsis Find large items in mailbox(es) using EWS Managed API 2.2..Description Find all 'large' items using the hidden 'AllItems' search folder. This method is much faster than enumerating folders and items to accomplish the same thing (faster as in hours, even days, depending on the number and size of mailboxes being searched). ... ...#>
Same file, but with the empty line removed, which fails:
<#PSScriptInfo .VERSION 1.0.0 .GUID 60e7a6d6-791b-48b7-be15-6e6a793f9812 .AUTHOR Jeremy.Bradshaw@Outlook.com .TAGS Exchange Outlook EWS EWS Managed API Large Items Migration .LICENSEURI https://github.com/JeremyTBradshaw/PowerShell .PROJECTURI https://github.com/JeremyTBradshaw/PowerShell/blob/master/LICENSE .RELEASENOTES#><#.Synopsis Find large items in mailbox(es) using EWS Managed API 2.2..Description Find all 'large' items using the hidden 'AllItems' search folder. This method is much faster than enumerating folders and items to accomplish the same thing (faster as in hours, even days, depending on the number and size of mailboxes being searched). ... ...#>
Error:
PS C:\Users\JB>Test-ScriptFileInfo-Path .\Desktop\Get-MailboxLargeItems.ps1Test-ScriptFileInfo: Script 'C:\Users\JB\Desktop\Get-MailboxLargeItems.ps1' is missing required metadata properties. Verify that the script file has Version, Guid, Description and Author properties. You can use the Update-ScriptFileInfo or New-ScriptFileInfo cmdlet to add or update the PSScriptInfo to the script file.
PowerShellGet version info:
PS C:\Users\JB>Get-Module powershellget | fl
Name : PowerShellGet
Path : C:\Users\JB\Documents\PowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1
Description : PowerShell module with commands for discovering, installing, updating and publishing the PowerShell
artifacts like Modules, DSC Resources, Role Capabilities and Scripts.
ModuleType : Script
Version : 2.2.5
PreRelease :
NestedModules : {}
ExportedFunctions : {Find-Command,Find-DscResource,Find-Module,Find-RoleCapability…}
ExportedCmdlets :
ExportedVariables : PSGetPath
ExportedAliases : {fimo, inmo, pumo, upmo}
The text was updated successfully, but these errors were encountered:
This issue was once opened in another repository: PowerShell/PowerShell#11173
The issue is present in Windows PowerShell 5.1, and PowerShell 7*. When you've got a script file which has the PSCriptInfo comment block, usually added/updated with New-/Update-ScriptFileInfo, if you remove the blank line between this comment block and the next comment block where you include your usual keywords/sections, Test-ScriptFileInfo fails, and since both New-/Update-ScriptFileInfo use Test-ScriptFileInfo, they also fail.
Sample file that passes:
Same file, but with the empty line removed, which fails:
Error:
PowerShellGet version info:
The text was updated successfully, but these errors were encountered: