I made a Powershell function just now and saved it to a ps1 file. However, when I try to execute it from within powershell, it won\'t run.
I\'ve allready changed to
This is a typical error across many platforms where your environment path does not include your current directory. so when you execute your script (or command or program etc), your runtime environment looks everywhere except your current/working directory.
Try
PS> .\listAllPaths.ps1 c:\ *.pdf testingPDF.txt
EDIT: After reading your comments, I'm going to suggest you try this. I haven't actually verified the logic of your PS script. I'm merely trying to get your script to execute first.
Try editing your script as below, and execute as above.
Function listAllPaths([string]$fromFolder, [string]$filter, [string]$printfile){
Get-ChildItem -Path $fromFolder -Include $filter -Recurse -Force -Name > $printfile
}
listAllPaths