【发布时间】:2018-02-20 16:41:44
【问题描述】:
我正在尝试获取文件名中包含今天日期的所有文件。但是,当我运行它时,我收到以下错误:
#Share location
$source = "U:\Data\*"
#Sharepoint file location
$prefix = "file_name_"
#Date Info
$date = get-date -uformat "%Y-%m-%d" | Out-String
$file = $prefix + $date
Get-ChildItem -File -path $source -Filter $file*
Get-ChildItem : 路径中的非法字符。在行:2 字符:1 + Get-ChildItem -File -path $source -Filter $file*
任何帮助将不胜感激。我在过滤器中使用$file*,因为文件扩展名可能不同。
【问题讨论】: