Creating a file in windows CI

Hello there, I have been trying to achieve something really simple with no luck despite trying any combination I could think of or I could see while searching for a solution online.

I want my CI to create a file containing the release notes information that will be used to automatically set the content of my release and fill an existing release notes file of past versions.

This is one part of what I am doing (NEXT_RELEASENOTES.txt exists on my repo obviously):

    - name: Create NEW_RELEASENOTES.txt
      run: |
        echo ## DefaultUnDo ${{ github.event.release.tag_name }}> package\NEW_RELEASENOTES.txt
        type documentation\NEXT_RELEASENOTES.txt >> package\NEW_RELEASENOTES.txt
        echo.>> package\NEW_RELEASENOTES.txt
        echo.>> package\NEW_RELEASENOTES.txt
        echo [nuget package](https://www.nuget.org/packages/DefaultUnDo/${{ github.event.release.tag_name }})>> package\NEW_RELEASENOTES.txt
        type package\NEW_RELEASENOTES.txt

This version fails with this message:

Line |
   2 |  echo ## DefaultUnDo 0.2.0> package\NEW_RELEASENOTES.txt
     |  ~~~~
     | Cannot process command because of one or more missing mandatory parameters: InputObject.

I have tried surrounding every echo/type lines with single quote, double quotes, and while doing this remove the error the file doesn’t seem to be produced as I try to use it later on. Example of the output I get:

  'echo ## DefaultUnDo 0.2.0> package\NEW_RELEASENOTES.txt'
  'type documentation\NEXT_RELEASENOTES.txt >> package\NEW_RELEASENOTES.txt'
  'echo.>> package\NEW_RELEASENOTES.txt'
  'echo.>> package\NEW_RELEASENOTES.txt'
  'echo [nuget package](https://www.nuget.org/packages/DefaultUnDo/0.2.0)>> package\NEW_RELEASENOTES.txt'
  'type package\NEW_RELEASENOTES.txt'
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
  env:
    DOTNET_ROOT: C:\Users\runneradmin\AppData\Local\Microsoft\dotnet
echo ## DefaultUnDo 0.2.0> package\NEW_RELEASENOTES.txt
type documentation\NEXT_RELEASENOTES.txt >> package\NEW_RELEASENOTES.txt
echo.>> package\NEW_RELEASENOTES.txt
echo.>> package\NEW_RELEASENOTES.txt
echo [nuget package](https://www.nuget.org/packages/DefaultUnDo/0.2.0)>> package\NEW_RELEASENOTES.txt
type package\NEW_RELEASENOTES.txt

Shouldn’t type package\NEW_RELEASENOTES.txt show me the content?!
Or does this actually works and it’s the actions I am using to update my release which is bugged

Run tubone24/update_release@v1.1.0
  with:
    release_name: DefaultUnDo 0.2.0
    body_path: ./package/NEW_RELEASENOTES.txt
  env:
    DOTNET_ROOT: C:\Users\runneradmin\AppData\Local\Microsoft\dotnet
    GITHUB_TOKEN: ***
Got release info: '36418764', , 'https://github.com/Doraku/DefaultUnDo/releases/tag/0.2.0', 'https://uploads.github.com/repos/Doraku/DefaultUnDo/releases/36418764/assets{?name,label},'
Body: 
Draft: false, Prerelease: false
Error: ENOENT: no such file or directory, open './package/NEW_RELEASENOTES.txt'

I feel like I am missing something very simple here… Thanks for the help.

soooo turns powershell don’t like this syntax (because of the > char I guess), switching to echo "## DefaultUnDo ${{ github.event.release.tag_name }}" | Out-File package\NEW_RELEASENOTES.txt fixed it.