Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update-ScriptFileInfo adds two new lines to script file on each execution #696

Open
3 tasks done
jazuntee opened this issue Mar 19, 2023 · 1 comment
Open
3 tasks done

Comments

@jazuntee
Copy link

Prerequisites

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

Steps to reproduce

Run the following command multiple times. Each time it adds two new lines between PSScriptInfo block and the description block.

Update-ScriptFileInfo '<ScriptPath>' -Version 1.1

Updated Script header:

<#PSScriptInfo

.VERSION 1.1

...
#> 

### <== 2 new lines are added here every time the command is run

<# 

.DESCRIPTION 
 asdf 

#> 
param ()

Expected behavior

When updating the script info, only the updated values will be updated in the file.

Actual behavior

The script file grows indefinitely with two new lines added with each run.

Error details

No Errors

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.3
PSEdition                      Core
GitCommitId                    7.3.3
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

2.2.5

Visuals

No response

@LegendEvent
Copy link

Same problem with powershell version 5.1.22621.2506

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants