Easy, is a relative answer specific to the skills of the individual, As the others have commented, there is no out of the box thing / tool you can use or buy to do this. It's all manual work, using the pointers and others who have tried to see what you can glean to accomplish you use case.
For example, this, in your block...
filename=${f##*/};
folder=${filename%.*}
mkdir "${folder}";
... is easily translated into...
$filename='PathToFileName'
$foldername='PathToFolder'
mkdir 'FolderName'
Now, that translation is really simplistic, and obviously not complete. That is something you'll have to figure out, using the resources pointed to and the PowerShell built-in help file and those examples.
There are several posts on this very forum on this conversion topic and how others have come to a consensus oh what / if anything can be done.
For example the below will highlight the efforts you'll need to traverse to accomplish X or Y.
Convert simple Bash script to PowerShell?
I am looking to port this bash code to PowerShell. Can anyone shed
some PowerShell light on this one?
Convert simple Bash script to PowerShell?
Convert bash script into Windows script
I have the following Unix shell script. I would like to convert this
into a Windows .bat file (I know I can use Cygwin instead of adapting
it to a Windows environment. But Cygwin is not an option for me).
Convert bash script into Windows script
Convert xargs Bash command to PowerShell?
I've got a simple Bash command to resize some images automatically on
a low-traffic website using ImageMagick - I'd like to convert this to
a PowerShell command so I don't have to install Cygwin on my
webserver.
Convert xargs Bash command to PowerShell?
As noted, there are paid for avenues / even online ones who can potentially be an avenue.
But, you should really read up a bit more on how to do specific things, like..
- Creating files and folders
- Accessing/Reading files, importing files, filtering files
- Loops
- Operators (comparison and assignment)
- Navigating the file system/PSDrive