GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ReadMe Guides for generating a temporary `global.json` are incorrect for Windows- CMD vs PWSH · Issue #683 · actions/setup-dotnet

ReadMe Guides for generating a temporary global.json are incorrect for Windows- CMD vs PWSH #683

New issue
Copy link
New issue
Copy link
Closed
Closed
ReadMe Guides for generating a temporary global.json are incorrect for Windows- CMD vs PWSH#683
Copy link
Assignees
v-priya-kinthali
Labels
bugSomething isn't working

Description

@SimonDarksideJ
SimonDarksideJ
opened on Nov 22, 2025
Issue body actions

Description:
A clear and concise description of what the bug is.
We ran in to an issue with the instructions in the readme for generating a global.json in our automated repository (to force dotnet 9 in a dotnet 10 workd)

Matrix testing with temporary global.json creation

However, the default shell for windows is "cmd" which results in an escape file output containing single quotes

'{ "sdk": { "version": "9.0.304" } }'

In DotNet 9 and above, this results in a malformed global.json and will break any automation running dotnet commands using it.

To resolve this

The documentation should make clear that the shell should be changed to pwsh which outputs the global.json correctly.

Task version:
5

Platform:

  • Ubuntu
  • macOS
  • [ X] Windows

Runner type:

  • Hosted
  • [ X] Self-hosted

Repro steps:

Simply use the instructions on a windows host without setting a shell or using "cmd"

      - name: Create temporary global.json
        run: echo '{"sdk":{"version": "${{ steps.stepid.outputs.dotnet-version }}"}}' > ./global.json

      - name: Create temporary global.json
        run: echo '{"sdk":{"version": "${{ steps.stepid.outputs.dotnet-version }}"}}' > ./global.json
        shell: cmd

To make the command work correctly, the instructions should INSIST that PWSH or bash is used on windows (where supported)

      - name: Create temporary global.json
        run: echo '{"sdk":{"version": "${{ steps.stepid.outputs.dotnet-version }}"}}' > ./global.json
        shell: pwsh

Expected behavior:
A well formed json should be generated using the instructions

Actual behavior:
dotnet commands fail due to a malformed json configuration

Activity

  1. SimonDarksideJ
    added
    bugSomething isn't working
    needs triage
    on Nov 22, 2025
  2. v-chiranjib-swain commented on Nov 24, 2025

    @v-chiranjib-swain
    v-chiranjib-swain
    on Nov 24, 2025
    Contributor
    More actions

    Hi @SimonDarksideJ , Thank you for creating this issue. We will investigate it and provide feedback as soon as we have some updates.

  3. v-chiranjib-swain
    removed
    needs triage
    on Nov 24, 2025
  4. v-priya-kinthali
    self-assigned this
    on Nov 24, 2025
  5. v-priya-kinthali commented on Jan 21, 2026

    @v-priya-kinthali
    v-priya-kinthali
    on Jan 21, 2026
    Contributor
    More actions

    Hello @SimonDarksideJ👋,
    Thank you for bringing this to our attention and for your detailed explanation. We have updated the README with a note recommending the use of pwsh or bash when generating a temporary global.json on Windows to avoid formatting issues, as part of the merged PR#692.

    Since this issue has now been addressed, I will proceed to close it for now.. Please feel free to reach out if you have any further questions or concerns. Thank you again!

    Reacted by Frulfump
  6. v-priya-kinthali
    closed this as completedon Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @v-priya-kinthali
    v-priya-kinthali

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.