FileHandling/Get-FileListFromFolder.ps1
<# .Synopsis Gets comma separated list of all files in a folder .Description Gets comma separated list of all files in a folder .Parameter workFolder The path to the folder the file list should be taken from .Example Get-FileListFromFolder -workFolder "C:\test" #> function Get-FileListFromFolder { param( [parameter (Mandatory=$True)] [string] $workFolder ) $fileList = "" foreach ($f in Get-ChildItem($workFolder)) { $fileList += $f.name + "," } return ($fileList.TrimEnd(",")) } |