#Creation de la page HTML
$hostname = "Serveur 1";
$date = Date;
[System.Collections.ArrayList] $lignes = @()
$lignes += 'Installation ServerView RAID;OK/KO'
$lignes += 'Installation MegaRAID;OK/KO'
$lignes += 'Installation AD-Domain-Services;OK/KO'
$lignes += 'Installation DHCP;OK/KO'
$lignes += 'Installation Hyper-V;OK/KO'
$lignes += 'Installation SNMP;OK/KO'
$VersionWindows = "Windows Server 2016"
$NumeroDeSerie = "QSXRTFYJ5YIFL48"
$CPU = "Celeron 2 Duo"
$RAM = "256MB"
$NombreDeDisque = "1"
$EtatDisque = "OK"
$EtatRaid = "OK"
$HTML = @"
$hostname
$date
| Version de Windows |
$VersionWindows |
| Date |
$date |
| Numéro de série |
$NumeroDeSerie |
| Processeur |
$CPU |
| RAM |
$RAM |
| Nombre de disque |
$NombreDeDisque |
| Etat disque |
$EtatDisque |
| Etat Raid |
$EtatRaid |
| Disque C |
|
| Disque D |
|
| Disque E |
|
| Disque F |
|
"@
$table = @"
ETAPE 1
|
Status |
"@
ForEach($elem in $lignes){
$ligne = $elem.Split(';')
$ligne0=$ligne[0]
$ligne1=$ligne[1]
$table += @"
| $ligne0 |
$ligne1 |
"@
}
$table += '
'
$HTML += $table
$HTML | Out-file "C:\Users\arobert\Desktop\Powershell etapes en HTML\index1.html"