Hi
Here is the deal. I have an object with system information. Server Name, SP version, IPaddress, Domain
but the outcome in the IP Address is
IPAddress : 10.222.219.139 fe80::41bd:f635:28c9:dfe8
I would like to split the IPaddress into two lines when I put it on Html.
10.222.219.139
fe80::41bd:f635:28c9:dfe8
here is the code
Function Get-HGSystemInfo{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[string]$ComputerName ,
[Parameter()]
[string]$ErrorLogFilePath = $HGErrorLogPreference
)
Write-Verbose "Gathering system Info" -Verbose
$os = Get-WmiObject -class Win32_Operatingsystem -ComputerName $ComputerName -Credential $cred
$cs = Get-WmiObject -Class Win32_ComputerSystem -ComputerName $ComputerName -Credential $cred
$network = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -ComputerName $ComputerName -Credential $cred|
where 'IPEnabled' -EQ "True"
$props = @{ 'ComputerName' = $ComputerName;
'OSversion' = $os.caption;
'SPversion' = $os.CSDVersion;
'Manufacturer' = $cs.Manufacturer;
'Model' = $cs.Model;
'TotalPhysicalMemory' = $cs.TotalPhysicalMemory / 1gb -as [int];
'Domain' = $cs.Domain;
'IPAddress' = $network.IPAddress -as [string]
}
$osObj = New-Object -TypeName PSObject -Property $props
Write-Verbose "Done Gathering system Info"
Write-Output $osObj
}
$os_html = Get-HGSystemInfo -ComputerName $servername |ConvertTo-EnhancedHTMLFragment -DivCssID ‘OS’ -TableCssClass ‘PaintRow’ -As list -PreContent “System Info” `
-Properties ComputerName, OSversion, SPversion,TotalPhysicalMemory,Manufacturer,Model,IPAddress ,Domain |Out-String
$os_html
$Title = “Windows SIC Verification”
$head = @"
Windows SIC Verification
$servername
This report was run: $(get-date)
"@
ConvertTo-Html -Title $Title -Head $head -PreContent $os_html |out-file $htmlReport
System Info
Computername : LQVWA93A0009.ent.wfb.bank.qa
OSversion : Microsoft Windows Server 2012 R2 Standard
SPversion :
TotalPhysicalMemory : 8
Manufacturer : VMware, Inc.
Model : VMware Virtual Platform
IPAddress : 10.222.219.139 fe80::41bd:f635:28c9:dfe8
Domain : ent.wfb.bank.qa
How can I do it?