PowerShell result to HTML report format
up vote
1
down vote
favorite
Currently I'm stuck in outputing the below PowerShell result into a HTML report. I have the below PowerShell script to query through to get replication result.
Get-3parRCopy > showrcopy.txt
$a = (Get-Content showrcopy.txt -Raw) -split "(?sm)^Names+Target.*?`r?`n" |
Select-Object -Skip 1 |
ForEach-Object { ($_ -split 's')[0] }
foreach ($b in $a) { Get-3parRCopy -groups $b }
The result from the above is as below
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP001Temp 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 00:08:09 MYT, Period 3h,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
LUN001-Temp 13304 LUN001-TempDR 16914 Synced 2018-11-04 00:08:10 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP002-PHY01 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:17:54 MYT, Period 2h,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
LUN001-VVT2.12 120 LUN001-VVT2.12 210 Syncing (33%) 2018-11-03 23:51:04 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP003-PHY02 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:27:12 MYT, Period 1h45m,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
LUN002-VVT2.14 130 LUN002-VVT2.14 207 Syncing (49%) 2018-11-03 23:59:27 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP001-PRD-ORA 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 00:45:09 MYT, Period 2h,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
ORA-PROD-VG01.35 97 ORA-PROD-VG01.35 2451 Synced 2018-11-04 00:45:54 MYT
ORA-PROD-VG02.36 98 ORA-PROD-VG02.36 2452 Synced 2018-11-04 00:46:10 MYT
ORA-PROD-VG03.37 99 ORA-PROD-VG03.37 2453 Synced 2018-11-04 00:45:48 MYT
ORA-PROD-VG04.38 100 ORA-PROD-VG04.38 2454 Synced 2018-11-04 00:45:12 MYT
ORA-PROD-VG05.39 101 ORA-PROD-VG05.39 2455 Synced 2018-11-04 00:45:12 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP001-PRD-SAP 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:24:25 MYT, Period 23m,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
SAP-PROD-APPS.4 80 SAP-PROD-APPS.4 1474 Synced 2018-11-04 01:24:28 MYT
SAP-PROD-LOCK.19 95 SAP-PROD-LOCK.19 1490 Synced 2018-11-04 01:24:25 MYT
SAP-PROD-SAPDT1.5 81 SAP-PROD-SAPDT1.5 1475 Synced 2018-11-04 01:25:16 MYT
SAP-PROD-SAPDT2.6 82 SAP-PROD-SAPDT2.6 1476 Synced 2018-11-04 01:25:05 MYT
SAP-PROD-SAPDT3.7 83 SAP-PROD-SAPDT3.7 1477 Synced 2018-11-04 01:25:07 MYT
SAP-PROD-SAPDT4.8 84 SAP-PROD-SAPDT4.8 1478 Synced 2018-11-04 01:25:41 MYT
SAP-PROD-SAPDT5.9 85 SAP-PROD-SAPDT5.9 1479 Synced 2018-11-04 01:25:35 MYT
SAP-PROD-SAPDT6.10 86 SAP-PROD-SAPDT6.10 1480 Synced 2018-11-04 01:25:56 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP002-PRD-SAP 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:24:55 MYT, Period 23m,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
SAP-PROD-VG01.10 15 SAP-PROD-VG01.10 29769 Synced 2018-11-04 01:28:44 MYT
How can I output the above result into HTML with the format like below.
powershell
|
show 1 more comment
up vote
1
down vote
favorite
Currently I'm stuck in outputing the below PowerShell result into a HTML report. I have the below PowerShell script to query through to get replication result.
Get-3parRCopy > showrcopy.txt
$a = (Get-Content showrcopy.txt -Raw) -split "(?sm)^Names+Target.*?`r?`n" |
Select-Object -Skip 1 |
ForEach-Object { ($_ -split 's')[0] }
foreach ($b in $a) { Get-3parRCopy -groups $b }
The result from the above is as below
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP001Temp 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 00:08:09 MYT, Period 3h,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
LUN001-Temp 13304 LUN001-TempDR 16914 Synced 2018-11-04 00:08:10 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP002-PHY01 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:17:54 MYT, Period 2h,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
LUN001-VVT2.12 120 LUN001-VVT2.12 210 Syncing (33%) 2018-11-03 23:51:04 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP003-PHY02 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:27:12 MYT, Period 1h45m,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
LUN002-VVT2.14 130 LUN002-VVT2.14 207 Syncing (49%) 2018-11-03 23:59:27 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP001-PRD-ORA 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 00:45:09 MYT, Period 2h,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
ORA-PROD-VG01.35 97 ORA-PROD-VG01.35 2451 Synced 2018-11-04 00:45:54 MYT
ORA-PROD-VG02.36 98 ORA-PROD-VG02.36 2452 Synced 2018-11-04 00:46:10 MYT
ORA-PROD-VG03.37 99 ORA-PROD-VG03.37 2453 Synced 2018-11-04 00:45:48 MYT
ORA-PROD-VG04.38 100 ORA-PROD-VG04.38 2454 Synced 2018-11-04 00:45:12 MYT
ORA-PROD-VG05.39 101 ORA-PROD-VG05.39 2455 Synced 2018-11-04 00:45:12 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP001-PRD-SAP 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:24:25 MYT, Period 23m,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
SAP-PROD-APPS.4 80 SAP-PROD-APPS.4 1474 Synced 2018-11-04 01:24:28 MYT
SAP-PROD-LOCK.19 95 SAP-PROD-LOCK.19 1490 Synced 2018-11-04 01:24:25 MYT
SAP-PROD-SAPDT1.5 81 SAP-PROD-SAPDT1.5 1475 Synced 2018-11-04 01:25:16 MYT
SAP-PROD-SAPDT2.6 82 SAP-PROD-SAPDT2.6 1476 Synced 2018-11-04 01:25:05 MYT
SAP-PROD-SAPDT3.7 83 SAP-PROD-SAPDT3.7 1477 Synced 2018-11-04 01:25:07 MYT
SAP-PROD-SAPDT4.8 84 SAP-PROD-SAPDT4.8 1478 Synced 2018-11-04 01:25:41 MYT
SAP-PROD-SAPDT5.9 85 SAP-PROD-SAPDT5.9 1479 Synced 2018-11-04 01:25:35 MYT
SAP-PROD-SAPDT6.10 86 SAP-PROD-SAPDT6.10 1480 Synced 2018-11-04 01:25:56 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP002-PRD-SAP 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:24:55 MYT, Period 23m,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
SAP-PROD-VG01.10 15 SAP-PROD-VG01.10 29769 Synced 2018-11-04 01:28:44 MYT
How can I output the above result into HTML with the format like below.
powershell
foreach ($b in $a) { Get-3parRCopy -groups $b } | Convertto-Html
, does this work for you?
– Moerwald
Nov 12 at 6:52
directly convertto-html does not work for me..
– Faizal Izham
Nov 12 at 7:22
Do you actually have the desired html output in text format? (And not only an image) Or do you want us to write the html code too?
– marsze
Nov 12 at 8:46
For one thing: don't write cmdlet output to a file then read the file back into PowerShell. That will turn your data into a flat string even if it was a list of structured objects before. What kind of output does your cmdlet produce (Get-3parRCopy | Get-Member
)? For usingConvertTo-Html
you need a list of objects. If your output is flat text anyway you'll have to parse it into objects first.
– Ansgar Wiechers
Nov 12 at 9:26
Hi marsze, i have the resulted output as per above but not in html format. would appreciate if you can help to get code to just convert the data to html format in the desired output just a plain table format that would be suffice. i can try to figure out to get the color coding later on.
– Faizal Izham
Nov 12 at 10:08
|
show 1 more comment
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Currently I'm stuck in outputing the below PowerShell result into a HTML report. I have the below PowerShell script to query through to get replication result.
Get-3parRCopy > showrcopy.txt
$a = (Get-Content showrcopy.txt -Raw) -split "(?sm)^Names+Target.*?`r?`n" |
Select-Object -Skip 1 |
ForEach-Object { ($_ -split 's')[0] }
foreach ($b in $a) { Get-3parRCopy -groups $b }
The result from the above is as below
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP001Temp 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 00:08:09 MYT, Period 3h,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
LUN001-Temp 13304 LUN001-TempDR 16914 Synced 2018-11-04 00:08:10 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP002-PHY01 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:17:54 MYT, Period 2h,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
LUN001-VVT2.12 120 LUN001-VVT2.12 210 Syncing (33%) 2018-11-03 23:51:04 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP003-PHY02 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:27:12 MYT, Period 1h45m,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
LUN002-VVT2.14 130 LUN002-VVT2.14 207 Syncing (49%) 2018-11-03 23:59:27 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP001-PRD-ORA 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 00:45:09 MYT, Period 2h,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
ORA-PROD-VG01.35 97 ORA-PROD-VG01.35 2451 Synced 2018-11-04 00:45:54 MYT
ORA-PROD-VG02.36 98 ORA-PROD-VG02.36 2452 Synced 2018-11-04 00:46:10 MYT
ORA-PROD-VG03.37 99 ORA-PROD-VG03.37 2453 Synced 2018-11-04 00:45:48 MYT
ORA-PROD-VG04.38 100 ORA-PROD-VG04.38 2454 Synced 2018-11-04 00:45:12 MYT
ORA-PROD-VG05.39 101 ORA-PROD-VG05.39 2455 Synced 2018-11-04 00:45:12 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP001-PRD-SAP 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:24:25 MYT, Period 23m,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
SAP-PROD-APPS.4 80 SAP-PROD-APPS.4 1474 Synced 2018-11-04 01:24:28 MYT
SAP-PROD-LOCK.19 95 SAP-PROD-LOCK.19 1490 Synced 2018-11-04 01:24:25 MYT
SAP-PROD-SAPDT1.5 81 SAP-PROD-SAPDT1.5 1475 Synced 2018-11-04 01:25:16 MYT
SAP-PROD-SAPDT2.6 82 SAP-PROD-SAPDT2.6 1476 Synced 2018-11-04 01:25:05 MYT
SAP-PROD-SAPDT3.7 83 SAP-PROD-SAPDT3.7 1477 Synced 2018-11-04 01:25:07 MYT
SAP-PROD-SAPDT4.8 84 SAP-PROD-SAPDT4.8 1478 Synced 2018-11-04 01:25:41 MYT
SAP-PROD-SAPDT5.9 85 SAP-PROD-SAPDT5.9 1479 Synced 2018-11-04 01:25:35 MYT
SAP-PROD-SAPDT6.10 86 SAP-PROD-SAPDT6.10 1480 Synced 2018-11-04 01:25:56 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP002-PRD-SAP 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:24:55 MYT, Period 23m,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
SAP-PROD-VG01.10 15 SAP-PROD-VG01.10 29769 Synced 2018-11-04 01:28:44 MYT
How can I output the above result into HTML with the format like below.
powershell
Currently I'm stuck in outputing the below PowerShell result into a HTML report. I have the below PowerShell script to query through to get replication result.
Get-3parRCopy > showrcopy.txt
$a = (Get-Content showrcopy.txt -Raw) -split "(?sm)^Names+Target.*?`r?`n" |
Select-Object -Skip 1 |
ForEach-Object { ($_ -split 's')[0] }
foreach ($b in $a) { Get-3parRCopy -groups $b }
The result from the above is as below
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP001Temp 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 00:08:09 MYT, Period 3h,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
LUN001-Temp 13304 LUN001-TempDR 16914 Synced 2018-11-04 00:08:10 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP002-PHY01 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:17:54 MYT, Period 2h,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
LUN001-VVT2.12 120 LUN001-VVT2.12 210 Syncing (33%) 2018-11-03 23:51:04 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP003-PHY02 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:27:12 MYT, Period 1h45m,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
LUN002-VVT2.14 130 LUN002-VVT2.14 207 Syncing (49%) 2018-11-03 23:59:27 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP001-PRD-ORA 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 00:45:09 MYT, Period 2h,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
ORA-PROD-VG01.35 97 ORA-PROD-VG01.35 2451 Synced 2018-11-04 00:45:54 MYT
ORA-PROD-VG02.36 98 ORA-PROD-VG02.36 2452 Synced 2018-11-04 00:46:10 MYT
ORA-PROD-VG03.37 99 ORA-PROD-VG03.37 2453 Synced 2018-11-04 00:45:48 MYT
ORA-PROD-VG04.38 100 ORA-PROD-VG04.38 2454 Synced 2018-11-04 00:45:12 MYT
ORA-PROD-VG05.39 101 ORA-PROD-VG05.39 2455 Synced 2018-11-04 00:45:12 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP001-PRD-SAP 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:24:25 MYT, Period 23m,auto_recover,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
SAP-PROD-APPS.4 80 SAP-PROD-APPS.4 1474 Synced 2018-11-04 01:24:28 MYT
SAP-PROD-LOCK.19 95 SAP-PROD-LOCK.19 1490 Synced 2018-11-04 01:24:25 MYT
SAP-PROD-SAPDT1.5 81 SAP-PROD-SAPDT1.5 1475 Synced 2018-11-04 01:25:16 MYT
SAP-PROD-SAPDT2.6 82 SAP-PROD-SAPDT2.6 1476 Synced 2018-11-04 01:25:05 MYT
SAP-PROD-SAPDT3.7 83 SAP-PROD-SAPDT3.7 1477 Synced 2018-11-04 01:25:07 MYT
SAP-PROD-SAPDT4.8 84 SAP-PROD-SAPDT4.8 1478 Synced 2018-11-04 01:25:41 MYT
SAP-PROD-SAPDT5.9 85 SAP-PROD-SAPDT5.9 1479 Synced 2018-11-04 01:25:35 MYT
SAP-PROD-SAPDT6.10 86 SAP-PROD-SAPDT6.10 1480 Synced 2018-11-04 01:25:56 MYT
Remote Copy System Information
Status: Started, Normal
Group Information
Name Target Status Role Mode Options
GRP002-PRD-SAP 3PARSYSTEM1 Started Primary Periodic Last-Sync 2018-11-04 01:24:55 MYT, Period 23m,over_per_alert
LocalVV ID RemoteVV ID SyncStatus LastSyncTime
SAP-PROD-VG01.10 15 SAP-PROD-VG01.10 29769 Synced 2018-11-04 01:28:44 MYT
How can I output the above result into HTML with the format like below.
powershell
powershell
edited Nov 12 at 9:19
Ansgar Wiechers
139k12120183
139k12120183
asked Nov 12 at 6:14
Faizal Izham
203
203
foreach ($b in $a) { Get-3parRCopy -groups $b } | Convertto-Html
, does this work for you?
– Moerwald
Nov 12 at 6:52
directly convertto-html does not work for me..
– Faizal Izham
Nov 12 at 7:22
Do you actually have the desired html output in text format? (And not only an image) Or do you want us to write the html code too?
– marsze
Nov 12 at 8:46
For one thing: don't write cmdlet output to a file then read the file back into PowerShell. That will turn your data into a flat string even if it was a list of structured objects before. What kind of output does your cmdlet produce (Get-3parRCopy | Get-Member
)? For usingConvertTo-Html
you need a list of objects. If your output is flat text anyway you'll have to parse it into objects first.
– Ansgar Wiechers
Nov 12 at 9:26
Hi marsze, i have the resulted output as per above but not in html format. would appreciate if you can help to get code to just convert the data to html format in the desired output just a plain table format that would be suffice. i can try to figure out to get the color coding later on.
– Faizal Izham
Nov 12 at 10:08
|
show 1 more comment
foreach ($b in $a) { Get-3parRCopy -groups $b } | Convertto-Html
, does this work for you?
– Moerwald
Nov 12 at 6:52
directly convertto-html does not work for me..
– Faizal Izham
Nov 12 at 7:22
Do you actually have the desired html output in text format? (And not only an image) Or do you want us to write the html code too?
– marsze
Nov 12 at 8:46
For one thing: don't write cmdlet output to a file then read the file back into PowerShell. That will turn your data into a flat string even if it was a list of structured objects before. What kind of output does your cmdlet produce (Get-3parRCopy | Get-Member
)? For usingConvertTo-Html
you need a list of objects. If your output is flat text anyway you'll have to parse it into objects first.
– Ansgar Wiechers
Nov 12 at 9:26
Hi marsze, i have the resulted output as per above but not in html format. would appreciate if you can help to get code to just convert the data to html format in the desired output just a plain table format that would be suffice. i can try to figure out to get the color coding later on.
– Faizal Izham
Nov 12 at 10:08
foreach ($b in $a) { Get-3parRCopy -groups $b } | Convertto-Html
, does this work for you?– Moerwald
Nov 12 at 6:52
foreach ($b in $a) { Get-3parRCopy -groups $b } | Convertto-Html
, does this work for you?– Moerwald
Nov 12 at 6:52
directly convertto-html does not work for me..
– Faizal Izham
Nov 12 at 7:22
directly convertto-html does not work for me..
– Faizal Izham
Nov 12 at 7:22
Do you actually have the desired html output in text format? (And not only an image) Or do you want us to write the html code too?
– marsze
Nov 12 at 8:46
Do you actually have the desired html output in text format? (And not only an image) Or do you want us to write the html code too?
– marsze
Nov 12 at 8:46
For one thing: don't write cmdlet output to a file then read the file back into PowerShell. That will turn your data into a flat string even if it was a list of structured objects before. What kind of output does your cmdlet produce (
Get-3parRCopy | Get-Member
)? For using ConvertTo-Html
you need a list of objects. If your output is flat text anyway you'll have to parse it into objects first.– Ansgar Wiechers
Nov 12 at 9:26
For one thing: don't write cmdlet output to a file then read the file back into PowerShell. That will turn your data into a flat string even if it was a list of structured objects before. What kind of output does your cmdlet produce (
Get-3parRCopy | Get-Member
)? For using ConvertTo-Html
you need a list of objects. If your output is flat text anyway you'll have to parse it into objects first.– Ansgar Wiechers
Nov 12 at 9:26
Hi marsze, i have the resulted output as per above but not in html format. would appreciate if you can help to get code to just convert the data to html format in the desired output just a plain table format that would be suffice. i can try to figure out to get the color coding later on.
– Faizal Izham
Nov 12 at 10:08
Hi marsze, i have the resulted output as per above but not in html format. would appreciate if you can help to get code to just convert the data to html format in the desired output just a plain table format that would be suffice. i can try to figure out to get the color coding later on.
– Faizal Izham
Nov 12 at 10:08
|
show 1 more comment
1 Answer
1
active
oldest
votes
up vote
0
down vote
ConvertTo-Html cmdlet has a Head parameter that allows you to specify the HTML code that will go into the HEAD element. So you can create CSS style tags to obtain the desired format.
A good article can be found here: https://4sysops.com/archives/building-html-reports-in-powershell-with-convertto-html/
sorry i have tried to do exactly what was written in the tutorial before.. but the output is not as expected.. but with get-psdrive it produce the same output as per the tutorial.
– Faizal Izham
Nov 12 at 10:13
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
ConvertTo-Html cmdlet has a Head parameter that allows you to specify the HTML code that will go into the HEAD element. So you can create CSS style tags to obtain the desired format.
A good article can be found here: https://4sysops.com/archives/building-html-reports-in-powershell-with-convertto-html/
sorry i have tried to do exactly what was written in the tutorial before.. but the output is not as expected.. but with get-psdrive it produce the same output as per the tutorial.
– Faizal Izham
Nov 12 at 10:13
add a comment |
up vote
0
down vote
ConvertTo-Html cmdlet has a Head parameter that allows you to specify the HTML code that will go into the HEAD element. So you can create CSS style tags to obtain the desired format.
A good article can be found here: https://4sysops.com/archives/building-html-reports-in-powershell-with-convertto-html/
sorry i have tried to do exactly what was written in the tutorial before.. but the output is not as expected.. but with get-psdrive it produce the same output as per the tutorial.
– Faizal Izham
Nov 12 at 10:13
add a comment |
up vote
0
down vote
up vote
0
down vote
ConvertTo-Html cmdlet has a Head parameter that allows you to specify the HTML code that will go into the HEAD element. So you can create CSS style tags to obtain the desired format.
A good article can be found here: https://4sysops.com/archives/building-html-reports-in-powershell-with-convertto-html/
ConvertTo-Html cmdlet has a Head parameter that allows you to specify the HTML code that will go into the HEAD element. So you can create CSS style tags to obtain the desired format.
A good article can be found here: https://4sysops.com/archives/building-html-reports-in-powershell-with-convertto-html/
answered Nov 12 at 9:00
reverpie
18616
18616
sorry i have tried to do exactly what was written in the tutorial before.. but the output is not as expected.. but with get-psdrive it produce the same output as per the tutorial.
– Faizal Izham
Nov 12 at 10:13
add a comment |
sorry i have tried to do exactly what was written in the tutorial before.. but the output is not as expected.. but with get-psdrive it produce the same output as per the tutorial.
– Faizal Izham
Nov 12 at 10:13
sorry i have tried to do exactly what was written in the tutorial before.. but the output is not as expected.. but with get-psdrive it produce the same output as per the tutorial.
– Faizal Izham
Nov 12 at 10:13
sorry i have tried to do exactly what was written in the tutorial before.. but the output is not as expected.. but with get-psdrive it produce the same output as per the tutorial.
– Faizal Izham
Nov 12 at 10:13
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53256756%2fpowershell-result-to-html-report-format%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
foreach ($b in $a) { Get-3parRCopy -groups $b } | Convertto-Html
, does this work for you?– Moerwald
Nov 12 at 6:52
directly convertto-html does not work for me..
– Faizal Izham
Nov 12 at 7:22
Do you actually have the desired html output in text format? (And not only an image) Or do you want us to write the html code too?
– marsze
Nov 12 at 8:46
For one thing: don't write cmdlet output to a file then read the file back into PowerShell. That will turn your data into a flat string even if it was a list of structured objects before. What kind of output does your cmdlet produce (
Get-3parRCopy | Get-Member
)? For usingConvertTo-Html
you need a list of objects. If your output is flat text anyway you'll have to parse it into objects first.– Ansgar Wiechers
Nov 12 at 9:26
Hi marsze, i have the resulted output as per above but not in html format. would appreciate if you can help to get code to just convert the data to html format in the desired output just a plain table format that would be suffice. i can try to figure out to get the color coding later on.
– Faizal Izham
Nov 12 at 10:08