2016-04-14 35 views
0

'daki bir dize için tek tırnak ve bir koma nasıl koyarım Satır sonunda virgülle tırnak koymayı deniyorum, ancak bunu nasıl başarabileceğimi düşünemiyorum. Şimdiye kadar sadece tek bir alıntıyı virgülle sonlandırabilirim, ama ben de satırın başına tek bir alıntı koymak istiyorum. Biripowershell

yardım edebilir,

#Define Variables 
$a = 'P:\Powershell practice\Movefolder\LD.txt' 
$b = get-content $a 

#Define Functions 
function append-text { 
process{ 
foreach-object {$_ + "',"} 
} 
} 

#Process Code 
$b | append-text 

cevap

0

Bu benim, 'test1' başarmak istiyorum ama şu anda ben test1' yaptığım tek ki?

function append-text { 
process{ 
foreach-object {"'" + $_ + "',"} 
} 
} 
+0

Mükemmel, bu özellik çalışıyor – sanees