Bare PowerShell is quite odd if you’re using it on daily basis. There are no out-of-box such functions as add to environment path, get server shares, or convert to YAML. Eventually, you create a batch of scripts to regular usage. My toolset for PowerShell contains around 30 small scripts and modules. However, I remember each line of code, as my favourite post about vimrc (Good vimrc – Doug Black) is telling us:
Don’t put any lines in your vimrc that you don’t understand.
So, when you are working with plenty of log files on a remote server, it takes some time to receive file list. There are two options: set a logger to put files in separated directories or to arrange these files by a script periodically when needed. I am not keen on any side, but when I need to arrange files (not only logs) I’m using following script.
The script creates folders for each found file group and moves them there. It works only in a passed folder without recursive.