ConvertTo-HTML Tips

Jeff Hicks shows off some of the niceties of Powershell’s ConvertTo-HTML cmdlet:

This is because Convertto-Html, like Export-CSV and Export-Clixml, take the entire object. This is not just the default result you see on the screen. Remember, everything will be treated as a string. In my example, if I want a similar HTML file, I will have to recreate the output with Select-Object. This might require piping the original result to Get-Member to discover the “real” property names.

It won’t output beautiful results, but with the appropriate CSS theming, you can generate good internal reports.

Related Posts

Default Parameter Values In Powershell

Chrissy LeMaire explains what $PSDefaultParameterValues is and places where she finds it useful: $PSDefaultParameterValues is a hashtable available in PowerShell that can set defaults for any command that you run. In it’s simplest form, setting a default parameter value can look like this: 1 $PSDefaultParameterValues = @{ ‘Get-DbaDatabase:Verbose’ = $true } After running the above code, Get-DbaDatabase will show […]

Read More

Power BI Administration With Powershell

Adam Saxton shares a video covering what is available in the MicrosoftPowerBIMgmt Powershell module: The Power BI PowerShell and the Admin API allow you to quickly inventory your organization and manage workspaces and access. Forget the hastle of setting up the App registration within Azure Active Directory for API access, the Power BI PowerShell cmdlets […]

Read More

Categories

July 2017
MTWTFSS
« Jun Aug »
 12
3456789
10111213141516
17181920212223
24252627282930
31