Skip to content

"Cannot load PSReadline module" when powershell is run with a service/daemon account #3011

@0byt3

Description

@0byt3

Steps to reproduce

create ./local/share/powershell/Modules directory in user's home to avoid errors from that
(also need to give it permissions to the account)
sudo -i -u cacti powershell -command Write-Host "hello"

Expected behavior

Output the text "hello"

Actual behavior

Write-Host : The term 'Write-Host' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or
if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Write-Host hello
+ ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Write-Host:String) [], CommandN
   otFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Environment data

Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.14
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Metadata

Metadata

Assignees

Labels

Resolution-FixedThe issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtime

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions