首页 > 解决方案 > 如何让 Powershell 识别带有变音符号“ä”的文件名?

问题描述

我正在运行以下 Powershell 代码:

$regFiles = @(
    'regs_10_2019-04-10-07_58_48_geän.csv'
)
$base = 'C:\Temp'

$regFiles | %{
    $f = "$base\Archive\$_"
    # vvv This throws an error because it cannot find the file with the 'ä'
    move-item -Path $f -Destination $base
}

如果文件名中包含“ä”,则 Powershell 找不到。有没有办法让 Powershell 识别文件名?

谢谢。

标签: powershell

解决方案


推荐阅读