Script de rangement pour trier vos fichiers en un clin d’oeil.
Pour voir le script en entier
leblogduwis powershell-ranger-votre-bureau
Voici un extrait du script PowerShell pour ranger votre bureau : créé par le blogduwis.com (Wisy) et source u/zazierx sur Reddit.
$pathToUse = "C:\Users\$env:username\Desktop"
$video = @(
'3g2','3gp','3gpp','asf','avi','divx','f4v',
'flv','h264','ifo','m2ts','m4v','mkv','mod','mov',
'mp4','mpeg','mpg','mswmm','mts','mxf','ogv','rm',
'srt','swf','ts','vep','vob','webm','wlmp','wmv'
)
......
$files = Get-ChildItem -Path $pathToUse
Foreach ($x in $files){
if($docs.Contains($x.Extension.TrimStart('.').ToLower())){
New-Item -ItemType Directory -Path $pathToUse -Name "Documents" -ErrorAction Ignore
Move-Item -Path $x.FullName -Destination $pathToUse/"Documents"
........
}
}
[!TIP] Il est possible d’épingler dans l’explorateur de fichier le raccourci PowerShell pour le lancer plus rapidement.
This is a PowerShell script to sort your desktop files. It was created by the blogduwis.com (Wisy) and the source is u/zazierx on Reddit.
[!TIP] It is possible to pin the PowerShell shortcut in the file explorer to launch it more quickly.