微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决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”确实存在。
谢谢。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。