Powershell 启动进程在事件操作中不执行任何操作

Powershell 启动进程在事件操作中不执行任何操作,powershell,pdf,adobe,Powershell,Pdf,Adobe,我正在使用: $fsw=新对象IO.FileSystemWatcher(获取位置).Drive.Root,“*.pdf”-属性@{ IncludeSubdirectories=$true; NotifyFilter=[IO.NotifyFilters]'FileName' } 注册ObjectEvent$fsw重命名-操作{ $path=$Event.SourceEventArgs.FullPath 启动进程–FilePath$path–动词打印–PassThru |%{sleep 5;$|}停

我正在使用:

$fsw=新对象IO.FileSystemWatcher(获取位置).Drive.Root,“*.pdf”-属性@{
IncludeSubdirectories=$true;
NotifyFilter=[IO.NotifyFilters]'FileName'
}
注册ObjectEvent$fsw重命名-操作{
$path=$Event.SourceEventArgs.FullPath
启动进程–FilePath$path–动词打印–PassThru |%{sleep 5;$|}停止进程
}
要尝试监视重命名的PDF(.tmp文件在浏览器下载完成后重命名),请使用
启动进程
使用Adobe打开文件,并在不使用打印对话框的情况下打印。
启动流程
行来自许多其他联机示例,在PowerShell中作为一行代码运行良好,但在重命名事件的
-Action
中似乎没有任何作用。我有什么遗漏或做错了吗

提前谢谢