【发布时间】:2015-11-21 17:43:11
【问题描述】:
Set-ExecutionPolicy Unrestricted
$start_path ="D:\VST\"
$start_path> Get-ChildItem-Recurse |
foreach { cd $_.DirectoryName; "VST_Screenshot_Tool"; cd ..; }
这应该在根目录和$start_path 的所有子文件夹中运行VST_Screenshot_Tool.exe。我收到此错误:
Expressions are only allowed as the first element of a pipeline.
At C:\Users\pithy\Desktop\screenshotter.ps1:2 char:13
+ $start_path <<<< ="D:\ZZ_AUDIO\VST etc\__ARCHIVE\*" |
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ExpressionsMustBeFirstInPipeline
任何指针将不胜感激。
【问题讨论】:
标签: powershell windows-7