I wanted to load windows application log into sql server table. I am using below command but it was throwing error.
Can anyone help me on how to fix this problem.
Followed below article to load the windows event log to a table. I created below table and ran below powershell command
CREATE TABLE [dbo].[EventViewer]
[Index] [int] NULL,
[Time] [datetime] NULL,
[EntryType] [varchar](MAX) NULL,
[Source] [varchar](MAX) NULL,
[InstanceID] [varchar](MAX) NULL,
[Message] [varchar](MAX) NULL
Get-EventLog -ComputerName <machine name> -LogName Application -After "30-03-2020" | select index,TimeGenerated,EntryType,Source,InstanceID,Message | Out-DataTable | Write-DataTable -ServerInstance <machine name> -Database master -TableName EventViewer
Out-DataTable : The term 'Out-DataTable' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:159
+ ... Generated,EntryType,Source,InstanceID,Message | Out-DataTable | Write ...
+ CategoryInfo : ObjectNotFound: (Out-DataTable:String) , CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\> Get-Host | Select-Object Version