PowerShell / PowerShell/PSResourceGet

Install-PSResource installs Script module to lowercase directory

Open
#1,446 16 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs-Attention :wave:
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

Install a PSM1/PSD1 module with a mixed-case name (e.g., MyModule) using Install-PSResource.

Expected behavior
The module should install to C:\...\Modules\MyModule\ and be find-able as a PowerShell module.
Actual behavior
When I install a module with a mixed-case name (e.g., MyModule) using Install-Module, it installs perfectly. When I use Install-PSResource, it installs successfully, but installs it in C:\...\Modules\mymodule\ (i.e. lowercase) instead of C:\...\Modules\MyModule\. This doesn't cause any problem for PS under Windows, but on case-sensitive *nix platforms, the module can't be found and, therefore, can't be loaded (without manually renaming the install directory).
Error details

No response

Environment data
Name              : Microsoft.PowerShell.PSResourceGet
Path              : C:\Users\rick\Documents\PowerShell\Modules\Microsoft.PowerShell.PSResourceGet\1.0.0\Microsoft.PowerShell.PSResourceGet.dll
Description       : PowerShell module with commands for discovering, installing, updating and publishing the PowerShell artifacts like Modules, Scripts, and DSC Resources.
ModuleType        : Binary
Version           : 1.0.0
PreRelease        :
NestedModules     : {Microsoft.PowerShell.PSResourceGet}
ExportedFunctions : Import-PSGetRepository
ExportedCmdlets   : {Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository, Get-PSScriptFileInfo…}
ExportedVariables :
ExportedAliases   : {fdres, Get-PSResource, isres, pbres…}



Name                           Value
----                           -----
PSVersion                      7.3.8
PSEdition                      Core
GitCommitId                    7.3.8
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
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 by reproducing Install-PSResource with a mixed-case PSM1/PSD1 module on a case-sensitive *nix platform, comparing its installation path with Install-Module. Trace the module installation entry point and existing module discovery behavior; done means the original directory casing is preserved and the installed module can be found and loaded.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.