Please feel free to provide feedback or file bugs here.

Multi Line description passes Test-ScriptFileInfo but fails to publish

When I tried to publish the script https://raw.githubusercontent.com/SQLDBAWithABeard/DataScienceVM/master/New-WindowsDataScienceVM.ps1 it fails with missing description but passed the Test-FileScriptInfo prior to me trying

1 vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    RobRob shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    4 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • J. Keith Bankston [MSFT]AdminJ. Keith Bankston [MSFT] (Admin, Windows Server) commented  ·   ·  Flag as inappropriate

        Thanks for the updated info. This appears to be fixed (or at least does not repro) with the latest version of PowerShellGet. Please update the powershellget version you have by doing the following:

        > Install-Module PowerShellGet
        > Install-PackageProvider -Name PowerShellGet

        After running this, restart PowerShell and retry the publishing (since the loaded version of the provider will be what was in place before running install-packageprovider).

        So that you know, for my repro case
        1. The difference in what you have installed versus my system is that my version of the PowerShellGet provider is 1.1.2.0.
        2. I made a local copy of your PS1 file, ran test-fileinfo on it, then used publish-script targeting a repo I have set up to a local fileshare.

        If you install 1.1.2.0, and still have this issue, please update this post.

      • RobRob commented  ·   ·  Flag as inappropriate

        PS C:\WINDOWS\system32> get-packageprovider

        Name Version DynamicOptions
        ---- ------- --------------
        msi 3.0.0.0 AdditionalArguments
        msu 3.0.0.0
        NuGet 2.8.5.207 Destination, ExcludeVersion, Scope, SkipDependencies, Header...
        PowerShellGet 1.0.0.1 PackageManagementProvider, Type, Scope, AllowClobber, SkipPu...
        Programs 3.0.0.0 IncludeWindowsInstaller, IncludeSystemComponent

      • RobRob commented  ·   ·  Flag as inappropriate

        PS C:\WINDOWS\system32> $PSVersionTable

        Name Value
        ---- -----
        PSVersion 5.1.14393.576
        PSEdition Desktop
        PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
        BuildVersion 10.0.14393.576
        CLRVersion 4.0.30319.42000
        WSManStackVersion 3.0
        PSRemotingProtocolVersion 2.3
        SerializationVersion 1.1.0.1

      • RobRob commented  ·   ·  Flag as inappropriate

        Using the file in the raw GitHub I get the following results

        PS C:\WINDOWS\system32> Test-ScriptFileInfo -Path C:\Temp\New-TestDataScienceVM.ps1

        Version Name Author Description
        ------- ---- ------ -----------
        1.0 New-TestDataScienceVM Rob Sewell This function will create a Windows Data Sci...

        PS C:\WINDOWS\system32> Publish-Script -Path C:\Temp\New-TestDataScienceVM.ps1 -NuGetApiKey $PSAPIKey
        Publish-PSArtifactUtility : Failed to publish script 'New-TestDataScienceVM': 'Failed to process
        request. 'There were errors extracting PowerShell metadata: The script file (.ps1) is missing required
        fields: Description. Update your script with the required fields and try publishing again.'.
        The remote server returned an error: (500) Internal Server Error..
        '.
        At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:2837 char:17
        + ... Publish-PSArtifactUtility -PSScriptInfo $PSScriptInfo `
        + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo : InvalidOperation: (:) [Write-Error], WriteErrorException
        + FullyQualifiedErrorId : FailedToPublishTheScript,Publish-PSArtifactUtility

        PS C:\WINDOWS\system32> $error[0]|fl -force

        writeErrorStream : True
        Exception : Microsoft.PowerShell.Commands.WriteErrorException: Failed to publish script
        'New-TestDataScienceVM': 'Failed to process request. 'There were errors
        extracting PowerShell metadata: The script file (.ps1) is missing required
        fields: Description. Update your script with the required fields and try
        publishing again.'.
        The remote server returned an error: (500) Internal Server Error..
        '.
        TargetObject :
        CategoryInfo : InvalidOperation: (:) [Write-Error], WriteErrorException
        FullyQualifiedErrorId : FailedToPublishTheScript,Publish-PSArtifactUtility
        ErrorDetails :
        InvocationInfo : System.Management.Automation.InvocationInfo
        ScriptStackTrace : at Publish-PSArtifactUtility, C:\Program
        Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1: line 8326
        at Publish-Script<Process>, C:\Program
        Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1: line 2837
        at <ScriptBlock>, <No file>: line 1
        PipelineIterationInfo : {0, 1}
        PSMessageDetails :

      Feedback and Knowledge Base