Convert to HTML Error

Hi I’m trying to test a function and pass it to the convertto-enhancedHTML and I get an error.

ConvertTo-EnhancedHTML : Parameter set cannot be resolved using the specified named parameters.
At line:25 char:14

here is the code

$filepath1 = “C:\Users\U611806\Desktop\MyFiles\PDFPowerShell\helderhtml.html”

$ComputerName = “localhost”

function Get-InfoOS {
$os = Get-WmiObject -class Win32_OperatingSystem -ComputerName $ComputerName
$props = @{‘OSVersion’=$os.version
New-Object -TypeName PSObject -Property $props

$params = @{ ‘As’=‘List’;
$html_os = get-infoOS -ComputerName $ComputerName |ConvertTo-EnhancedHTMLFragment @params

$params2 = @{ ‘Title’=‘System 1’;
‘Precontent’=‘H2>System 32 system’;

         ConvertTo-EnhancedHTML @params2   | Out-File -FilePath $filepath1

Try running your fragment through Out-String to start with. But the error usually means you haven’t provided enough parameters for the binding to figure out which parameter set you want to use.

same error. wonder is the syntas

$filepath = “C:\Users\U611806\Desktop\MyFiles\PDFPowerShell\html2.html”

$computer = “localhost”

function Get-InfoCompSystem {
$cs = Get-WmiObject -class Win32_ComputerSystem -ComputerName $ComputerName
$props = @{‘Model’=$cs.model;
‘RAM (GB)’=“{0:N2}” -f ($cs.totalphysicalmemory / 1GB);
New-Object -TypeName PSObject -Property $props

$params = @{‘As’=‘List’;
‘PreContent’=‘Computer System’}

$html_cs = Get-InfoCompSystem -ComputerName $computer |
ConvertTo-EnhancedHTMLFragment @params|Out-String

ConvertTo-EnhancedHTML -HTMLFragments $html_cs |Out-File $filepath