I want to create a loop function that looks like this:
function Loop { foreach ($File in Get-ChildItem | Select-Object -exp Name) { # Some command } }
It works perfectly fine for simple one-word commands, but it doesn't work for anything else. Of course, I need a way to parse all given arguments, but I don't know how. All documentations that I've been able to understand (I just started working with PowerShell about a week ago) don't seem to have an answer to this.
It would be great if someone could give me a solution to this problem.