You will most often use Bash functions to make your shell life easier; instead of typing out complex command pipelines, create a function and inject arguments. You'd place these in your bashrc file, ...
As a beginner to writing scripts with PowerShell, you won't learn the concept of a function until later. Newbies typically learn about PowerShell functions after they've learned what the pipeline is, ...
Don’t copy and paste the same code over and over again. Instead, create a PowerShell function and save yourself time.