Powershell get-childitem路径格式不受支持错误

时间:2020-10-28 17:01:22

标签: powershell get-childitem

Windows 7 sp1上的Powershell 5.1引发以下错误:

摘要:

$Lstfile= @(Get-ChildItem 'G:\BACKUPS\' -Filter *.zip | sort LastWriteTime | select -last 1 )

错误:

Get-ChildItem : The given path's format is not supported.
At C:\DailyBackup.ps1:101 char:13
+ $Lstfile= @(Get-ChildItem "G:\BACKUPS\" -Filter *.zip | sort LastWrit ...

    + CategoryInfo          : NotSpecified: (:) [Get-ChildItem], NotSupportedException
    + FullyQualifiedErrorId : System.NotSupportedException,Microsoft.PowerShell.Commands.GetChildItemCommand

目标是创建的最后一个备份文件的时间戳(使用过滤器“ * .zip”)。尝试了至少十二种不同的方法来导出最后修改的数据,所有方法均引发相同(或相似)错误“不支持给定路径的格式”
是的,“ G:\ Backups”确实存在。
谢谢。

0 个答案:

没有答案