Hi,
I have a text file & trying to convert it to html format. It’s working fine, but the data is not coming in tabular format.
Below is the script:
$SourceFile = “C:\temp\kalyan.txt”
$TargetFile = “C:\temp\kalyan.htm”
$File = Get-Content $SourceFile
$FileLine = @()
Foreach ($Line in $File) {
$MyObject = New-Object -TypeName PSObject
Add-Member -InputObject $MyObject -Type NoteProperty -Name Status -Value $Line
$FileLine += $MyObject
}
$FileLine | ConvertTo-Html -Property HealthCheck -body “Running Stausk” | Out-File $TargetFile
Can someone help me on how to get tabular format.
My text file contains below:
ServerName TimeStamp Status
Kalyan 2016-08-01T08:01:56 Running
-Kalyan