You could try something like this:
$InstanceIds = (import-csv -path c:\example\example.csv -header instanceid).instanceid |
Sort-Object -Unique
get-eventlog -logname system -instanceID $instanceids
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a .csv i am comparing againt the system eventlog I only want the macthing instanceid. i wrote..
get-eventlog -logname system -instanceID ${import-csv -path c:\example\example.csv -header instanceid}
I am new to PS and really shaking my head on this one
Answer accepted by question author
You could try something like this:
$InstanceIds = (import-csv -path c:\example\example.csv -header instanceid).instanceid |
Sort-Object -Unique
get-eventlog -logname system -instanceID $instanceids
PLEASE HELP I only need this one line fixed without multiple other codes
-InstanceId {import-csv -path C:\test\Appevt.csv -header instanceid}
this is error
Cannot bind parameter 'InstanceId'. Cannot convert the "@{instanceid=InstanceId}" value of type "CSV:Selected.System.Diagnostics.EventLogEntry" to type "System.Int64".
I know i'm close but for whatever reason i can't make it work