Function SCP-ImplementationFiles($selectedDirectory, $fileName) {
Write-Host $rdfFile.GetType() $rdfFile.Name
SCP-ImplementationFiles($directoryPrompt, $rdfFile.Name)
My Write-Host is providing output
System.IO.FileInfo file1.pdf
However when I pass it to my function, the 2nd parameter is always empty/null
I defined the function as close to the top of the script (in case it matters)
Not a duplicate of How do I pass multiple parameters into a function in PowerShell?
I am not trying to call a function from the prompt. I am trying to call the function from within the script. If I remove the ',' (comma), the editor tells me that there is a ',' missing
I've tried these functions to see if I did something wrong with the definition of my function
Function SCP-ImplementationFiles {
param([string]$selectedDirectory, [string]$fileName)
Write-Host $selectedDirectory
Write-Host $fileName
}
Function SCP-ImplementationFiles([string]$selectedDirectory, [string]$fileName) {
Write-Host $selectedDirectory
Write-Host $fileName
}
Function SCP-ImplementationFiles($selectedDirectory, $fileName) {
Write-Host $selectedDirectory
Write-Host $fileName
}