Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Clean-Desktop {
- ls
- #keep working dir for later
- $wd = pwd;
- cd ~/Desktop;
- $desktopitems = Get-ChildItem -Path ~/Desktop -File
- if (!(test-path -path "Images")) {write-host "Making directory Images"; mkdir Images} else {write-host "Images Directory already exists"}
- if (!(test-path -path "Video")) {write-host "Making directory Video"; mkdir Video} else {write-host "Video Directory already exists"}
- if (!(test-path -path "ISOs")) {write-host "Making directory ISOs"; mkdir ISOs} else {write-host "ISOs Directory already exists"}
- if (!(test-path -path "Scripts")) {write-host "Making directory Scripts"; mkdir Scripts} else {write-host "Scripts Directory already exists"}
- if (!(test-path -path "Zips")) {write-host "Making directory Zips"; mkdir Zips} else {write-host "Zips Directory already exists"}
- if (!(test-path -path "Applications")) {write-host "Making directory Applications"; mkdir Applications} else {write-host "Applications Directory already exists"}
- if (!(test-path -path "PDF")) {write-host "Making directory PDF"; mkdir PDF} else {write-host "PDF Directory already exists"}
- if (!(test-path -path "Links")) {write-host "Making directory Links"; mkdir Links} else {write-host "Links Directory already exists"}
- if (!(test-path -path "Books")) {write-host "Making directory Books"; mkdir Books} else {write-host "Books Directory already exists"}
- if (!(test-path -path "CSV")) {write-host "Making directory CSV"; mkdir CSV} else {write-host "CSV Directory already exists"}
- if (!(test-path -path "db")) {write-host "Making directory db"; mkdir db} else {write-host "db Directory already exists"}
- if (!(test-path -path "Shortcuts")) {write-host "Making directory Shortcuts"; mkdir Shortcuts} else {write-host "Shortcuts Directory already exists"}
- # if (!(test-path -path "ISOs")) {write-host "Making directory ISOs"; mkdir ISOs} else {write-host "ISOs Directory already exists"}
- mv *.jpg ./Images; mv *.png ./Images; mv *.gif ./Images; mv *.webp ./Images;
- mv *.avi ./Video; mv *.m4a ./Video; mv *.mp4 ./Video; mv *.mkv ./Video; mv *.flv ./Video; mv *.3gpp ./Video; mv *.webm ./Video;
- mv *.iso ./ISOs; mv *.img ./ISOs; mv *.img.gz ./ISOs; mv *.ova ./ISOs
- mv *.ps1 ./Scripts;
- mv *.zip ./Zips; mv *.tar ./Zips; mv *.tar.gz ./Zips;
- mv *.exe ./Applications; mv *.msi ./Applications
- mv *.pdf ./PDF; mv *.pdf ./PDF
- mv *.csv ./CSV; mv *.CSV ./CSV
- mv *.lnk ./Links;
- mv *.epub ./Books;
- mv *.lnk ./Shortcuts; mv *.url ./Shortcuts;
- mv *.db ./db; mv *.sql ./db;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement