![](/img/trans.png)
[英]How can I put an output that contains single quotes into a string in Powershell?
[英]how to put single quotes and a coma to a string in powershell
我试图将单引号用逗号放在行尾,但不知道如何实现。 到目前为止,我只能在逗号的末尾加上单引号,但是我也想在行的开头加上单引号。 有人可以帮忙吗
我想实现“ test1”,但目前我只能做“ test1”,
#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
这个?
function append-text {
process{
foreach-object {"'" + $_ + "',"}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.