{"id":27942253,"url":"https://github.com/hanachiru/dotnettoolinspector","last_synced_at":"2026-04-13T08:32:09.739Z","repository":{"id":291772247,"uuid":"965384490","full_name":"hanachiru/DotnetToolInspector","owner":"hanachiru","description":"PowreShell module to get the version of the .NET SDK required by dotnet tool.","archived":false,"fork":false,"pushed_at":"2025-05-07T17:51:57.000Z","size":512,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-07T14:09:26.722Z","etag":null,"topics":["dotnet","powershell"],"latest_commit_sha":null,"homepage":"https://www.powershellgallery.com/packages/DotnetToolInspector","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hanachiru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-13T03:28:57.000Z","updated_at":"2025-05-09T08:26:08.000Z","dependencies_parsed_at":"2025-07-07T14:09:28.966Z","dependency_job_id":"f30e203f-5169-4693-8def-1ac69daed119","html_url":"https://github.com/hanachiru/DotnetToolInspector","commit_stats":null,"previous_names":["hanachiru/dotnettoolinspector"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/hanachiru/DotnetToolInspector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanachiru%2FDotnetToolInspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanachiru%2FDotnetToolInspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanachiru%2FDotnetToolInspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanachiru%2FDotnetToolInspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hanachiru","download_url":"https://codeload.github.com/hanachiru/DotnetToolInspector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanachiru%2FDotnetToolInspector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31746101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T06:26:45.479Z","status":"ssl_error","status_checked_at":"2026-04-13T06:26:44.645Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","powershell"],"created_at":"2025-05-07T11:32:57.498Z","updated_at":"2026-04-13T08:32:09.720Z","avatar_url":"https://github.com/hanachiru.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DotnetToolInspector\n\nEnglish | [日本語](README_JP.md)\n\n`DotnetToolInspector` is a PowerShell module that retrieves the contents of the `runtimeconfig.json` for dotnet tools.\n\n```shell\n# Example of retrieving the runtimeconfig.json for the t4 command of dotnet-t4 v3.0.0\n$ Get-DotnetToolRuntimeConfig -packageID \"dotnet-t4\" -commandName \"t4\"\n{\n  \"runtimeOptions\": {\n    \"tfm\": \"net6.0\",\n    \"rollForward\": \"LatestMajor\",\n    \"framework\": {\n      \"name\": \"Microsoft.NETCore.App\",\n      \"version\": \"6.0.0\"\n    },\n    \"configProperties\": {\n      \"System.Reflection.Metadata.MetadataUpdater.IsSupported\": false\n    }\n  }\n}\n```\n\nFor example, it helps to check the required .NET SDK version to run the installed dotnet tool. This is particularly useful for determining which .NET SDK to install when using dotnet tools in GitHub Actions.\n\n`DotnetToolInspector` has the following features:\n\n- Supports global tools (`--global` and `--tool-path`) and local tools (`--local`)\n- Works on Ubuntu, Windows, and macOS\n- Provides `action.yml` for CI/CD usage\n\n# Table of Contents\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Basic Usage](#basic-usage)\n    - [Global Tools](#global-tools)\n    - [Local Tools](#local-tools)\n  - [CI/CD](#cicd)\n  - [Environment Variables](#environment-variables)\n\n# Requirements\n\n- PowerShell 6 or newer\n\n# Installation\n\nRun the following command in PowerShell:\n\n```shell\n$ Install-Module -Name DotnetToolInspector\n```\n\n**PowerShell Gallery: [DotnetToolInspector](https://www.powershellgallery.com/packages/DotnetToolInspector)**\n\n# Usage\n\n## Basic Usage\n\nUse `Get-DotnetToolRuntimeConfig` to retrieve the RuntimeConfig of a dotnet tool.\n\n```powershell\nGet-DotnetToolRuntimeConfig [-packageID] \u003cstring\u003e [-commandName] \u003cstring\u003e [[-toolPath] \u003cstring\u003e] [-global] [-local] [\u003cCommonParameters\u003e]\n```\n\nNote that the dotnet tool executable binary must be installed on the machine for it to work. For local tools, `dotnet tool restore` must be done beforehand.\n\nBelow is an example with [dotnet-t4](https://www.nuget.org/packages/dotnet-t4#readme-body-tab). Sample code is also available [here](.github/workflows/sample2.yml).\n\n### Global Tools\n\n```powershell\n# for 'dotnet tool install dotnet-t4 --global'\n$ Get-DotnetToolRuntimeConfig -packageID \"dotnet-t4\" -commandName \"t4\" -global\n{\n  \"runtimeOptions\": {\n    \"tfm\": \"net6.0\",\n    \"rollForward\": \"LatestMajor\",\n    \"framework\": {\n      \"name\": \"Microsoft.NETCore.App\",\n      \"version\": \"6.0.0\"\n    },\n    \"configProperties\": {\n      \"System.Reflection.Metadata.MetadataUpdater.IsSupported\": false\n    }\n  }\n}\n\n# for 'dotnet tool install dotnet-t4 --tool-path \u003cpath-to-your-tool-path\u003e'\n$ Get-DotnetToolRuntimeConfig -packageID \"dotnet-t4\" -commandName \"t4\" -toolPath \"path\\to\\your\\tool-path\"\n{\n  \"runtimeOptions\": {\n    \"tfm\": \"net6.0\",\n    \"rollForward\": \"LatestMajor\",\n    \"framework\": {\n      \"name\": \"Microsoft.NETCore.App\",\n      \"version\": \"6.0.0\"\n    },\n    \"configProperties\": {\n      \"System.Reflection.Metadata.MetadataUpdater.IsSupported\": false\n    }\n  }\n}\n```\n\n### Local Tools\n\n```powershell\n# for 'dotnet tool install dotnet-t4 --local'\n$ Get-DotnetToolRuntimeConfig -packageID \"dotnet-t4\" -commandName \"t4\"\n{\n  \"runtimeOptions\": {\n    \"tfm\": \"net6.0\",\n    \"rollForward\": \"LatestMajor\",\n    \"framework\": {\n      \"name\": \"Microsoft.NETCore.App\",\n      \"version\": \"6.0.0\"\n    },\n    \"configProperties\": {\n      \"System.Reflection.Metadata.MetadataUpdater.IsSupported\": false\n    }\n  }\n}\n```\n\n## CI/CD\n\nSample code is available [here](.github/workflows/sample.yml).\n\n```yaml\nname: Sample\non: workflow_dispatch\n\njobs:\n  sample:\n    name: Sample\n    runs-on: ubuntu-latest\n    steps:\n      # Checkout Sample Data\n      - name: check out\n        uses: actions/checkout@v4\n\n      # Check .NET SDK Version\n      - name: Example -toolPath\n        id: toolpath\n        uses: hanachiru/DotnetToolInspector@main\n        with:\n          package-id: dotnet-t4\n          command-name: t4\n          tool-path: ./Tests/Data/tool-path\n\n      # Setup .NET\n      - name: Setup Dotnet\n        uses: actions/setup-dotnet@v4\n        with:\n          dotnet-version: ${{ steps.toolpath.outputs.framework-version-major }}\n```\n\nIf you want to retrieve information about local tools, make sure to run `dotnet tool restore` beforehand.\n\n```yml\n- name: dotnet tool restore\n  working-directory: ./Tests/Data/local\n  run: |\n    dotnet tool restore\n- name: Example -local\n  uses: hanachiru/DotnetToolInspector@main\n  with:\n    package-id: dotnet-t4\n    command-name: t4\n    working-directory: ./Tests/Data/local\n```\n\nSet `global: true` if you want to use `-global`.\n\n```yml\n- name: dotnet tool install\n  run: |\n    dotnet tool install dotnet-t4 --global\n- name: Example -global\n  uses: hanachiru/DotnetToolInspector@main\n  with:\n    package-id: dotnet-t4\n    command-name: t4\n    global: true\n```\n\n## Environment Variables\n\nThe following environment variables can modify the behavior. For details, refer to the [official documentation](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables).\n\n| **Environment Variable** | **Description**                                                                                                                                               | **Default Value**           |\n| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |\n| DOTNET_CLI_HOME          | Specifies the location where supporting files for .NET CLI commands should be written.                                                                        | _Default value for each OS_ |\n| NUGET_PACKAGES           | Configures a path to the [NuGet `global-packages` folder](https://learn.microsoft.com/nuget/consume-packages/managing-the-global-packages-and-cache-folders). | _Default value for each OS_ |\n\nThe default values of the `DOTNET_CLI_HOME` and `NUGET_PACKAGES` environment variables depend on the operating system used on the runner:\n| **Operating System** | `DOTNET_CLI_HOME` | `NUGET_PACKAGES` |\n| --------------------- | -------------------------- | -------------------------- |\n| **Windows** | `%userprofile%\\.dotnet\\tools` | `%userprofile%\\.nuget\\packages` |\n| **Ubuntu** | `~/.dotnet/tools` | `~/.nuget/packages` |\n| **macOS** | `~/.dotnet/tools` | `~/.nuget/packages` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanachiru%2Fdotnettoolinspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanachiru%2Fdotnettoolinspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanachiru%2Fdotnettoolinspector/lists"}