Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

powershell.exe -Command parameter should handle quotes consistently across hosts and platforms #1583

Copy link
Copy link
@vors

Description

@vors
Issue body actions

Steps to reproduce

powershell -Noprofile -Command '"[Console]::Error.Write(""""foo"""")"'

Expected behavior

This is inbox windows v5.1 behavior

PS C:\> $powershell = Join-Path -Path $PsHome -ChildPath "powershell"
PS C:\> & $powershell -Noprofile -Command '"[Console]::Error.Write(""""foo"""")"'
fooPS C:\>

Actual behavior

"where are quotes around foo"?

PS /Users/vors/dev/PowerShell> $powershell = Join-Path -Path $PsHome -ChildPath "powershell"                                                 
PS /Users/vors/dev/PowerShell> & $powershell -Noprofile -Command '"[Console]::Error.Write(""""foo"""")"'                                     
At line:1 char:24                                                                                                                            
+ [Console]::Error.Write(foo)                                                                                                                
+                        ~                                                                                                                   Missing ')' in method call.                                                                                                                 
 At line:1 char:24                                                                                                                            + [Console]::Error.Write(foo)                                                                                                                
+                        ~~~
Unexpected token 'foo' in expression or statement.
At line:1 char:27
+ [Console]::Error.Write(foo)
+                           ~
Unexpected token ')' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingEndParenthesisInMethodCall

Environment data

> $PSVersionTable
Name                           Value                                                                                                        
----                           -----                                                                                                        
PSVersion                      5.1.10032.0                                                                                                  
PSEdition                      PowerShellCore                                                                                               
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                      
BuildVersion                   3.0.0.0                                                                                                      
GitCommitId                    v6.0.0-alpha.7                                                                                               
CLRVersion                                                                                                                                  
WSManStackVersion              3.0                                                                                                          
PSRemotingProtocolVersion      2.3                                                                                                          
SerializationVersion           1.1.0.1
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done
    Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.