は、次のPowerShellのコードを考えてみてください。私のコンピュータでPowerShellは、ここで文字列に入れる改行文字をどこから取得しますか?
@"
"@.GetEnumerator() | %{[int]$_}
これはそれぞれ、キャリッジ・リターンおよび改行のASCII制御文字の10進表現である
13
10
を出力します。
The same code executed on AppVeyor outputs just a single number:つまり
10
、PowerShellはシステム間でここに文字列で使用する文字の間にばらつきがあるようです。私は、ソースが[System.Environment]::newline
ため[System.Environment]::newline
が、the same environment AppVeyor environment that output the single character in the here string, output
13
10
ことが期待しました。 [System.Environment]::newline
は、ここの文字列の改行のソースではないようです。
。 GetEnumerator()|%{[int] '$ _}" | "{"} " sc Test1.ps1; "@" "' '' '' '' '' @。GetEnumerator()|%{[int] '$ _}" | sc Test2.ps1; 。\ Test1.ps1 <#10#>; 。\ Test2.ps1 <#13, 10#> '' – PetSerAl
ありがとう@PetSerAl。 ["AppVeyorはWindows上のLF(\ n)エンディングでファイルをチェックアウトしています]"(http://help.appveyor.com/discussions/problems/1119-allow-changing-git-autocrlf-setting)はデフォルトで表示されます。 – alx9r