小编Jos*_*hua的帖子

Powershell脚本,用于根据创建时间戳将文件移动到年/月文件夹中

第一篇文章在这里...如果这格式不正确,我道歉...我将继续努力.我正在开发一个Powershell脚本,它将获取以下信息,以便我可以使用另一个完全适用于此点的批处理文件.随着我对Powershell的理解的增长......我很可能会更改批处理文件,因为它非常冗长.

TL:DR Newb与Powershell合作需要帮助

我希望Powershell为不包含任何子文件夹的文件夹中的每个文件输出单行信息.我希望我的txt文件看起来像这样:

文件创建date_full文件名路径

每行一个文件.稍后将将其解析为文本文件

这是我到目前为止...似乎我只需要一个for循环来运行类似这个psuedocode的东西,我应该很高兴去.在这一点上,任何帮助将不胜感激.

谢谢大家,我希望我不会用格式化来杀死你.

$USS_Folder="path\USS_Files\"
$uss_year=#4 digit year of file creation date
$uss_month=#2 digit year of file creation date
$uss_file=# Full filename including path and Creation_Date

New-Item -ItemType directory -Path $USS_Folder\$uss_year\$uss_month

Move-Item $uss_file $USS_Folder\$uss_year\$uss_month
Run Code Online (Sandbox Code Playgroud)

powershell

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

powershell ×1