Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 执行powershell脚本时出现警告_Windows_Powershell - Fatal编程技术网

Windows 执行powershell脚本时出现警告

Windows 执行powershell脚本时出现警告,windows,powershell,Windows,Powershell,这是我在本SE中提出的问题的继续。我已使用powershell执行此命令 $query = "SELECT * FROM Win32_DeviceChangeEvent WHERE EventType = 2" Register-WMIEvent -Query $query -Action { invoke-item "C:\Program Files\abc.exe"} 我已成功执行powersell脚本,但收到此警告。 您能否告诉我如何更正此问题将命令导入格式列表或尝试格式表-自动: R

这是我在本SE中提出的问题的继续。我已使用powershell执行此命令

$query = "SELECT * FROM Win32_DeviceChangeEvent WHERE EventType = 2"
Register-WMIEvent -Query $query -Action { invoke-item "C:\Program Files\abc.exe"}
我已成功执行powersell脚本,但收到此警告。


您能否告诉我如何更正此问题

将命令导入
格式列表
或尝试
格式表-自动

Register-WMIEvent -Query $query -Action { invoke-item "C:\Program Files\abc.exe"} | Format-List


您是否已尝试显式声明要显示的列?两个查询均无效作业状态为“未启动”。您还可以尝试将控制台的大小调整为120个字符宽。:-)我非常抱歉,但我是powershell的新手,我无法通过调整控制台的大小来理解?使用上面的脚本,我收到了这个消息
Register-WMIEvent -Query $query -Action { invoke-item "C:\Program Files\abc.exe"} | Format-Table -Auto