PowerShell / PowerShell/PSResourceGet

Update-PSScriptFileInfo modifies Description even when -Description parameter is not used

Open
#1,834 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs-Triage
Dominant language
C#
Stars
576
Forks
114
Avg merge
1d 2h
Merged PRs (30d)
7

Description

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.
Steps to reproduce

When Update-PSScriptInfo is used to change script metadata, the Description property of Comment-based help is modified event when Description parameter is not used.

The sample script to test the problem: Update-PSInfo.ps1

Expected behavior

Both the placement of Description property is changed and also, the formatting of content is changed.

Expected behavior
PS> Get-Content Update-PSInfo.ps1

<#PSScriptInfo
  .VERSION 1.0.0
. . .
#>
<#
  .SYNOPSIS
    A short synopsis
  .DESCRIPTION
    A longer description.

    Second paragraph
. . .

PS> Update-PSScriptFileInfo -Path Update-PSInfo.ps1 -Version 1.1.0
PS> Get-Content Update-PSInfo.ps1

<#PSScriptInfo
  .VERSION 1.1.0
. . .
#>
<#
  .SYNOPSIS
    A short synopsis
  .DESCRIPTION
    A longer description.

    Second paragraph
. . .
Actual behavior
PS> Update-PSScriptFileInfo -Path Update-PSInfo.ps1 -Version 1.1.0
PS> Get-Content Update-PSInfo.ps1

<#PSScriptInfo

.VERSION 1.1.0
. . .
#>
<#

.DESCRIPTION
    A longer description.
    Second paragraph

  .SYNOPSIS
    A short synopsis
. . .
Error details

Environment data
  • PowerShell version: 5.1, 7.5.1
  • PSResourceGet version: 1.1.1
Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Update-PSInfo.ps1 reproduction and the Update-PSScriptFileInfo entry point in PSResourceGet. Compare the expected and actual output when only -Version is supplied, then run the relevant existing tests if available. Done means the description remains in place with its paragraph formatting unchanged when -Description is omitted.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.