Advertisement
Guest User

Untitled

a guest
Mar 27th, 2022
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         function Clean-Desktop {
  2.                 ls
  3.                 #keep working dir for later
  4.                 $wd = pwd;
  5.                 cd ~/Desktop;
  6.                 $desktopitems = Get-ChildItem -Path ~/Desktop -File
  7.                         if (!(test-path -path "Images")) {write-host "Making directory Images"; mkdir Images} else {write-host "Images Directory already exists"}
  8.                         if (!(test-path -path "Video")) {write-host "Making directory Video"; mkdir Video} else {write-host "Video Directory already exists"}
  9.                         if (!(test-path -path "ISOs")) {write-host "Making directory ISOs"; mkdir ISOs} else {write-host "ISOs Directory already exists"}
  10.                         if (!(test-path -path "Scripts")) {write-host "Making directory Scripts"; mkdir Scripts} else {write-host "Scripts Directory already exists"}
  11.                         if (!(test-path -path "Zips")) {write-host "Making directory Zips"; mkdir Zips} else {write-host "Zips Directory already exists"}
  12.                         if (!(test-path -path "Applications")) {write-host "Making directory Applications"; mkdir Applications} else {write-host "Applications Directory already exists"}
  13.                         if (!(test-path -path "PDF")) {write-host "Making directory PDF"; mkdir PDF} else {write-host "PDF Directory already exists"}
  14.                         if (!(test-path -path "Links")) {write-host "Making directory Links"; mkdir Links} else {write-host "Links Directory already exists"}
  15.                         if (!(test-path -path "Books")) {write-host "Making directory Books"; mkdir Books} else {write-host "Books Directory already exists"}
  16.                         if (!(test-path -path "CSV")) {write-host "Making directory CSV"; mkdir CSV} else {write-host "CSV Directory already exists"}
  17.                         if (!(test-path -path "db")) {write-host "Making directory db"; mkdir db} else {write-host "db Directory already exists"}
  18.                         if (!(test-path -path "Shortcuts")) {write-host "Making directory Shortcuts"; mkdir Shortcuts} else {write-host "Shortcuts Directory already exists"}
  19.                         # if (!(test-path -path "ISOs")) {write-host "Making directory ISOs"; mkdir ISOs} else {write-host "ISOs Directory already exists"}
  20.                         mv *.jpg ./Images; mv *.png ./Images; mv *.gif ./Images; mv *.webp ./Images;
  21.                         mv *.avi ./Video; mv *.m4a ./Video; mv *.mp4 ./Video; mv *.mkv ./Video; mv *.flv ./Video; mv *.3gpp ./Video; mv *.webm ./Video;
  22.                         mv *.iso ./ISOs; mv *.img ./ISOs; mv *.img.gz ./ISOs; mv *.ova ./ISOs
  23.                         mv *.ps1 ./Scripts;
  24.                         mv *.zip ./Zips; mv *.tar ./Zips; mv *.tar.gz ./Zips;
  25.                         mv *.exe ./Applications; mv *.msi ./Applications
  26.                         mv *.pdf ./PDF; mv *.pdf ./PDF
  27.                         mv *.csv ./CSV; mv *.CSV ./CSV
  28.                         mv *.lnk ./Links;
  29.                         mv *.epub ./Books;
  30.                         mv *.lnk ./Shortcuts; mv *.url ./Shortcuts;
  31.                         mv *.db ./db; mv *.sql ./db;
  32.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement