PowerShell / PowerShell/PSResourceGet
AllUsers scope doesn't work if umask is set.
Aperta
Nessuno ha ancora preso questa issue.
Area-Install
Issue-Bug
Needs-Attention :wave:
- Lingua principale
- C#
- Stelle
- 576
- Fork
- 114
- Merge medio
- 1g 2h
- PR unite (30g)
- 7
Descrizione
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
Running on a linux machine
- running from a root bash shell
umask 0027pwshInstall-PSResource Az -Scope AllUsersGet-InstalledPSResource Az -Scope AllUsers- Notice that module is found
- In non-root pwsh:
Get-InstalledPSResource Az -Scope AllUsers - Notice that the module is not found
- In root bash shell:
chmod -R a+rX /usr/local/share/powershell/ - In non-root pwsh:
Get-InstalledPSResource Az -Scope AllUsers - Notice that the module is now found
Expected behavior
Module is available in root and non-root pwsh
Actual behavior
Module only available in root pwsh
Error details
PS /home/nfaulkne> Get-InstalledPSResource Az -Scope AllUsers
Get-InstalledPSResource: No match was found for package 'Az'.
PS /home/nfaulkne> Get-Error
Exception :
Type : Microsoft.PowerShell.PSResourceGet.UtilClasses.ResourceNotFoundException
Message : No match was found for package 'Az'.
HResult : -2146233088
TargetObject : Microsoft.PowerShell.PSResourceGet.Cmdlets.GetInstalledPSResourceCommand
CategoryInfo : ObjectNotFound: (Microsoft.PowerShel…edPSResourceCommand:GetInstalledPSResourceCommand) [Get-In
stalledPSResource], ResourceNotFoundException
FullyQualifiedErrorId : InstalledPackageNotFound,Microsoft.PowerShell.PSResourceGet.Cmdlets.GetInstalledPSResourceComma
nd
InvocationInfo :
MyCommand : Get-InstalledPSResource
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : 1
Line : Get-InstalledPSResource Az -Scope AllUsers
Statement : Get-InstalledPSResource Az -Scope AllUsers
PositionMessage : At line:1 char:1
+ Get-InstalledPSResource Az -Scope AllUsers
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InvocationName : Get-InstalledPSResource
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
0
1
Environment data
PS /root> Get-Module Microsoft.PowerShell.PSResourceGet; $PSVersionTable
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Binary 1.0.4.1 Microsoft.PowerShell.PSResourceGet {Find-PSResource, Get-InstalledPSResource, Get-PS…
Key : PSVersion
Value : 7.4.5
Name : PSVersion
Key : PSEdition
Value : Core
Name : PSEdition
Key : GitCommitId
Value : 7.4.5
Name : GitCommitId
Key : OS
Value : Ubuntu 22.04.3 LTS
Name : OS
Key : Platform
Value : Unix
Name : Platform
Key : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0…}
Name : PSCompatibleVersions
Key : PSRemotingProtocolVersion
Value : 2.3
Name : PSRemotingProtocolVersion
Key : SerializationVersion
Value : 1.1.0.1
Name : SerializationVersion
Key : WSManStackVersion
Value : 3.0
Name : WSManStackVersion
Visuals
No response
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo i comandi elencati Install-PSResource e Get-InstalledPSResource su Linux con umask 0027, confrontando le sessioni root e non root. Traccia i percorsi di installazione e individuazione di AllUsers; il lavoro è completato quando il modulo Az è disponibile per entrambe le sessioni senza eseguire manualmente chmod su /usr/local/share/powershell/.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp, linux, powershell
- Ambito
- cli, operating-systems, tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100