【发布时间】:2013-07-15 15:31:36
【问题描述】:
我正在编写一个简单的脚本,以递归方式列出包含单词“plugin”的文件夹“fullscreen”中的所有文件。 因为路径太长,而且没有必要,所以我决定获取文件名。 问题是所有文件都称为“index.xml”,因此获取:“包含文件夹+文件名”会非常有帮助。所以输出看起来像这样:
on\index.xml
off\index.xml
代替:
C:\this\is\a\very\long\path\fullscreen\on\index.xml
C:\this\is\a\very\long\path\fullscreen\off\index.xml
这就是我所拥有的:
dir .\fullscreen | sls plugin | foreach { write-host $($_).path }
我收到此错误:
无法将参数绑定到参数“路径”,因为它为空。
【问题讨论】:
标签: powershell