Reputation: 15002
This is the continuation of this question i have asked in this SE How to run a PowerShell script from a batch file .I have used powershell to execute this command
$query = "SELECT * FROM Win32_DeviceChangeEvent WHERE EventType = 2"
Register-WMIEvent -Query $query -Action { invoke-item "C:\Program Files\abc.exe"}
I have succesfully executed the powersell script but i am getting this warning.
Can you tell me how can i rectify this issue
Upvotes: 1
Views: 125
Reputation: 202002
Pipe the command to Format-List
or try Format-Table -Auto
:
Register-WMIEvent -Query $query -Action { invoke-item "C:\Program Files\abc.exe"} | Format-List
or
Register-WMIEvent -Query $query -Action { invoke-item "C:\Program Files\abc.exe"} | Format-Table -Auto
Upvotes: 2