I am developing a system that will post a log that I have hosted on a virtual server, for now just post the fields that I have not defined and post them in a generic way, the program will also parse it
clear-host
$contenido=Get-Content -Path \"mi direccion host virtual"\log.txt | Out-String
$obj = @()
foreach($line in ($contenido)){
$nline = $line.Split(",") #-replace """",""
$properties = @{
'NombreTienda' = $nline[1]
'NombreUsuario' = $nline[3]
'NombreEquipo' = $nline[5]
'VersionSO' = $nline[7]
'Fecha' = $nline[9]
'NumeroPOS'= $nline[11]
'Accion' = $nline[13]
}
$obj += New-Object PSObject -Property $properties
}
$obj
Invoke-RestMethod -Method POST -uri ""miuri"/logs" -Body '{"$obj"}' -ContentType 'application/json'