I am trying to make a script that will prompt the user for their computer name, then use that info in a Get-EventLog
line. I am new to powershell and I use to do it with batch scripts however I am not sure how to do it here.
This is what I have so far:
$name1 = Read-Host 'Enter name'
cls
Get-EventLog system -computername COMPUTERNAMEHERE -InstanceId 2147489657 -Newest 5 | ft EventID,TimeWritten,MachineName -AutoSize
Pause
Also... how do would I make this run by double clicking on it like you would with a batch script?