Hi,
I am unable to get the pie chart from the attached script, please help.
Error :
ConvertTo-Base64 : The term 'ConvertTo-Base64' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At D:\Pie_Report_4.0.ps1:55 char:29
+ $Script:PiechartImgSrc = ConvertTo-Base64 ($FileName + ".png")
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (ConvertTo-Base64:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
You have to copy and include that function (ConvertTo-Base64) as well.
Param (
[string] $ImgSrc
)
return [Convert]::ToBase64String((Get-Content $ImgSrc -Encoding byte))
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I assume you are using the PureStoragePowerShellToolkit as the source.
Since the ConvertTo-Base64 function is not a builtin cmdlet, you will have to include the function.
As an earlier version of the PureStoragePowerShellToolkit also did.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD,
I just copied a bit of code to generate piechart html report for Folder level VM Used CPU and Free CPU
When I tried, I am getting that error.
You have to copy and include that function (ConvertTo-Base64) as well.
Param (
[string] $ImgSrc
)
return [Convert]::ToBase64String((Get-Content $ImgSrc -Encoding byte))
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you very much, that worked