I make a function (function sword($href,$username,$path){} which 3 parameters, but the last one parameter ($path) value is 0 ("") at the function begining. The variable is definitly not zero! I checked before the function.
function convertToLinuxPath($path){...return $path}
function sword($href,$username,$path){
Write-Host $path #The path has not value here!!! Why???
$href = $href.replace("otherString","anotherString")
$bashFile = "/mnt/c/...xy.sh"
Write-Host $path
#wsl --exec $bashFile $href $dest
}
$link = Read-Host
$username = Read-Host
$folder = Read-Host
$path = convertToLinuxPath($folder) #This is another function
Write-Host $path #The $path has it value, here!!!
sword($link,$username,$path)
I tried convert to String, but i havent more idea.