Skip to content

PowerShell's dotnet global tool doesn't accept -WorkingDirectory option #10301

@philcarbone

Description

@philcarbone

Steps to reproduce

  1. Install powershell core via the dotnet global tool utility:
dotnet tool install --global PowerShell  
  1. run the new powershell command with the "Working Directory" option/flag:
pwsh -WorkingDirectory ~

Expected behavior

It is expected that this option works and the shell starts in the provided directory.

Actual behavior

The following error is thrown

-WorkingDirectory : The term '-WorkingDirectory' 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                                                                                         
+ -WorkingDirectory ~                                                                                    
+ ~~~~~~~~~~~~~~~~~                                                                                      
+ CategoryInfo          : ObjectNotFound: (-WorkingDirectory:String) [], CommandNotFoundException        + FullyQualifiedErrorId : CommandNotFoundException               

Environment data

Running install and pwsh command in:

Name                           Value                                                                     
----                           -----                                                                     
PSVersion                      5.1.18362.145                                                             
PSEdition                      Desktop                                                                   
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                   
BuildVersion                   10.0.18362.145                                                            
CLRVersion                     4.0.30319.42000                                                           
WSManStackVersion              3.0                                                                       PSRemotingProtocolVersion      2.3                                                                       SerializationVersion           1.1.0.1   

Installed pwsh (installed as global tool):

Name                           Value
----                           -----
PSVersion                      6.2.2
PSEdition                      Core
GitCommitId                    6.2.2
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-DuplicateThe issue is a duplicate.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions