小编Max*_*ate的帖子

连接路径和文件

我是PowerShell的新手,我很高兴我在编写新功能等方面有多远,但是这个让我难过,这么简单......

以下是功能:

Function fnConcatenatePathFile ([String]$Path, [String]$File)
{
   $FullPath = "$($Path)\$($File)"
   Return $FullPath
}
Run Code Online (Sandbox Code Playgroud)

然后我调用这个函数:

fnConcatenatePathFile ("C:\_Store", "run.sql")
Run Code Online (Sandbox Code Playgroud)

我希望结果如下:

"C:\_Store\run.sql"
Run Code Online (Sandbox Code Playgroud)

但相反,我得到:

"C:\_Store run.sql\"
Run Code Online (Sandbox Code Playgroud)

让我疯狂......任何线索?

variables powershell function

3
推荐指数
1
解决办法
1053
查看次数

标签 统计

function ×1

powershell ×1

variables ×1