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

Command line arguments with a dollar sign #4024

Copy link
Copy link
@Tibblez

Description

@Tibblez
Issue body actions

Command line arguments sent to a file do not send in full if the argument contains a dollar sign. I have tried every combination of escape character and quote configuration that I can think of. I am not certain if this is specific to the dollar sign but I was able to use single quotes with an exclamation mark in the argument and that worked fine.

I was not able to find any explanation for this in other open issues or the known issues but I apologize if I'm missing something obvious here.

Steps to reproduce

Create a new ps1 file called test.ps1 with this snippet.

param(
[string]$foo
)
write-host $foo

Then calling it from the command line

powershell ./test.ps1 -foo 'Before$After'

Expected behavior

Before$After

Actual behavior

Before

Environment data

> $PSVersionTable
Name                           Value                                                                           
----                           -----                                                                           
PSVersion                      6.0.0-beta                                                                      
PSEdition                      Core                                                                            
BuildVersion                   3.0.0.0                                                                         
CLRVersion                                                                                                     
GitCommitId                    v6.0.0-beta.2                                                                   
OS                             Linux 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016                 
Platform                       Unix                                                                            
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                         
PSRemotingProtocolVersion      2.3                                                                             
SerializationVersion           1.1.0.1                                                                         
WSManStackVersion              3.0                                                                             

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

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.