Home Dashboard Directory Help
Search

Here-strings in workflows use not standard line delimiter (10) instead of standard (13+10) by Roman Kuzmin


Status: 

Active


1
0
Sign in
to vote
Type: Bug
ID: 769986
Opened: 11/2/2012 11:28:39 PM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description


<#
The script below produces:

    In script: 49 13 10 50
    In workflow: 49 10 50

Instead of expected:

    In script: 49 13 10 50
    In workflow: 49 13 10 50

Thus, in scripts here-strings use standard line delimiter (13+10) but in a
workflow they use not standard (10). If such a string goes to a file and this
file is opened in Notepad then the whole text looks like a single line there.
#>

#################################################

$x = @'
1
2
'@

"In script: $([int[]][char[]]$x)"

workflow test-workflow {
    $x = @'
1
2
'@
    "In workflow: $([int[]][char[]]$x)"
}

test-workflow

#################################################
Details
Sign in to post a comment.
Posted by Roman Kuzmin on 11/7/2012 at 4:55 AM
Interesting. So you see the same result in ISE. As for the console, what are the actual line delimiters in the script file? If (13+10) (Windows standard) then you see yet another issue.
Posted by Aleksandar Nikolić on 11/6/2012 at 8:20 AM
I don't get the same result on Windows 7 + PowerShell 3.0 machine.

PowerShell ISE:
In script: 49 13 10 50
In workflow: 49 10 50

powershell.exe:
In script: 49 10 50
In workflow: 49 10 50
Posted by Roman Kuzmin on 11/6/2012 at 2:58 AM
@Aleksandar Nikolić - Yes. I tried console, ISE, and my custom host. The problem does not depend on a host.
Posted by Aleksandar Nikolić on 11/5/2012 at 1:15 PM
Do you get the same result in powershell.exe and PowerShell ISE?
Sign in to post a workaround.