我试图让文件名看起来像这样:
焦点131021a.wav
我已将日期声明为变量:
$DateFilename = get-date -format "yyMMdd"
但是,我不能在保留最后一个“a”字符的同时将该变量转换为字符串。以下是许多失败的试验中的一些......
PS C:\script> $FileName3 = "focus'$DateFilename`a.wav"
PS C:\script> echo $FileName3
focus'131021.wav
PS C:\script> $FileName3 = "focus$DateFilename'a.wav"
PS C:\script> echo $FileName3
focus131021'a.wav
PS C:\script> $FileName3 = "focus$DateFilename`a.wav"
PS C:\script> echo $FileName3
focus131021.wav
PS C:\script> $FileName3 = "focus$DateFilename'aa.wav"
PS C:\script> echo $FileName3
focus131021'aa.wav
PS C:\script> $FileName3 = "focus$DateFilename'a.wav"
PS C:\script> echo $FileName3
focus131021'a.wav