我制作了一个程序,在家用计算机上最新版本的Visual Studio中的富文本框中显示大量文本,即使文本中有换行符,程序也会收集内容中的所有内容。引号(例如TextBox1.Text =“多段写作”,这些引号内的所有内容都会变成红色,就像输出文本一样。现在,当我把程序放在运行Visual Studio 2013的学校计算机上时,它只是选择引号内的第一行文本并忽略其他行,因此无法运行,因为所有这些文本行都会导致错误。为什么会发生这种情况?
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
$file1,
[Parameter(Mandatory=$true)]
$file2
)
$content1 = Import-Csv -Path $file1
$content2 = Import-Csv -Path $file2
$props = $content1 | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name
$comparedLines = Compare-Object $content1 $content2 -Property $props -PassThru | Where-Object {$_.SideIndicator -eq "=>" }
$comparedLines | Export-csv -Path C:\FullPUF\Difference.csv –NoTypeInformation