返回列表 发帖
本帖最后由 newswan 于 2024-6-4 18:50 编辑

powershell
Param(
[Parameter(ValueFromRemainingArguments)]
[string[]]$Path
)
if ([string]::IsNullOrEmpty($Path)) {
$Path = "D:\Downloads"
}
$ext = "*.apk"
$isRecurse = $False
if ( $isRecurse ) {
$command = { Get-ChildItem -Filter $ext -File -Recurse }
} else {
$command = { Get-ChildItem -Filter $ext -File }
}
$Path | Invoke-Command -ScriptBlock $command | ForEach-Object {
write-host ( '' + $_.LastWriteTime + " : " + $_.FullName )
Rename-Item -Path $_.FullName -NewName ( '' + $_.LastWriteTime.ToString("yyyy-MMdd-HHmmss") + $_.Extension )
}COPY

TOP

返回列表