2022.06.05 20:31:58
dir * | foreach { Rename-Item $_ -NewName ($_.BaseName+”.mp4”) }首先找到占用端口的进程,然后终止进程:
netstat -nao | findstr "5554" # 假设5554端口被占用
taskkill -pid 5076 -f # 结束占用进程如果不指定Path则默认查找当前目录。查找支持正则表达式。
Get-ChildItem -Path C:\Users\JohnDoe -Filter *.txt -RecurseGet-ChildItem -Directory | ForEach-Object {
$gitDir = Join-Path $_.FullName ".git"
if (Test-Path $gitDir) {
Set-Location $_.FullName
git push
}
}