Site Search
- Privacy & cookies: This site uses only the cookies associated with WordPress and the installed widgets. I collect no data about you. Cookie Policy
Please Note:
All the scripts are saved as .txt files. Newer files have a "View Script" button which will let you save or open a script in notepad. For earlier posts, the easiest way to download with IE is to right click on the link and use "Save Target As". Rename file from Name_ext.txt to Name.ext.
To see a full post after searching, please click on the title.
PowerShell Scripts were written with Version 3 or 4.
https connections are supported.
All new users accounts must be approved, as are comments. Please be patient. It is pretty easy to figure out my email address from the scripts, and you are welcome to contact me that way.
Top Posts & Pages
- Remove DNS Host Record and PTR with PowerShell
- Create Import file for Remote Desktop Connection Manager 2.7
- Get the Parent OU for an AD Object
- Fixing SCCM 1603 Errors
- Get User's Email Address from SmartCard with PowerShell
- Export and Import Delegated OU Permissions with PowerShell
- Export DNS Server Records with PowerShell
- Convert System.DirectoryServices.SearchResult to a PSObject
- PowerShell:Start RDP After Reboot
- Auditing Active Directory Permissions with Powershell
Categories
Archives
Tag Archives: HTML Export
Export to HTML with Style Sheet Header
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
$txtColor = 'AliceBlue' $file = "$env:temp\TempHTML.htm" $HTMLHeader =@" <style> BODY{background-color:white;} TABLE{border-width: 1px;border-style: solid;border-color: black; border-collapse: collapse;margin-left:auto; margin-right:auto;} TH{border-width: 1px;padding: 1px;border-style: solid; border-color: black;background-color:$txtColor} TD{border-width: 1px;padding: 1px;border-style: solid; border-color: black;background-color:$txtColor} </style> "@ #Example $title= 'Service Information' Get-Service | Select-Object Status, Name, DisplayName,Starttype | ConvertTo-HTML -head $HTMLHeader -body "<center><H2>$title</H2><Font=Verdana></Center>" | Out-File $file Invoke-Expression $file |
This a modification of something I picked up on the web. It allows you to export to an HTML file with a centered table and centered title. Any number of properties in the data are made into auto-sized … Continue reading
Posted in PowerShell, Scripting, Scriptlets
Tagged HTML Export, Powershell Scriptlets
Leave a comment