wmiSystem.Name, wmiSystem.Domain, Hi allBelow is the code i tried for displaying the values using HTML. but when i am running the application, it is giving me output for only {0} to {4}.. others are not displaying.Please let me know what is the issue.$CurrentSystemHTML = @"<table><tr><td>Name</td><td>{0}</td></tr><tr><td>Domain</td><td>{1}</td></tr><tr><td>Manufacturer</td><td>{2}</td></tr><tr><td>Model</td><td>{3}</td></tr><tr><td>TotalRAM</td><td>{4}</td></tr> <tr><td>PhyProcessors</td><td>{5}</td></tr> <tr><td>LogicalProcessors</td><td>{6}</td></tr><tr><td>PageFilePath</td><td>{7}</td></tr><tr><td>PageFileSize</td><td>{8}</td></tr><tr><td>ComputerBrowser</td><td>{9}</td></tr><tr><td>WindowsUpdate</td><td>{10}</td></tr> <tr><td>SNMP</td><td>{11}</td></tr></table>"@ -f $wmiSystem.Name,$wmiSystem.Domain,$wmiSystem.Manufacturer,$wmiSystem.Model,"$([string]([System.Math]::Round($wmiSystem.TotalPhysicalMemory/1GB,2))) GB",$wmiSystem.NumberOfProcessors,$wmiSystem.NumberOfLogicalProcessors,$pf.Name,[String] $pf.AllocatedBaseSize + " MB",$strCBS.Status,$strWAU.Status,$strSNMP.StatusThank youWhat I have tried:$CurrentSystemHTML = @"Name{0}Domain{1}Manufacturer{2}Model{3}TotalRAM{4} PhyProcessors{5} LogicalProcessors{6}PageFilePath{7}PageFileSize{8}ComputerBrowser{9}WindowsUpdate{10} SNMP{11}"@ -f $wmiSystem.Name,$wmiSystem.Domain,$wmiSystem.Manufacturer,$wmiSystem.Model,"$([string]([System.Math]::Round($wmiSystem.TotalPhysicalMemory/1GB,2))) GB",$wmiSystem.NumberOfProcessors,$wmiSystem.NumberOfLogicalProcessors,$pf.Name,[String] $pf.AllocatedBaseSize + " MB",$strCBS.Status,$strWAU.Status,$strSNMP.Status 解决方案 CurrentSystemHTML = @"<table><tr><td>Name</td><td>{0}</td></tr><tr><td>Domain</td><td>{1}</td></tr><tr><td>Manufacturer</td><td>{2}</td></tr><tr><td>Model</td><td>{3}</td></tr><tr><td>TotalRAM</td><td>{4}</td></tr> <tr><td>PhyProcessors</td><td>{5}</td></tr> <tr><td>LogicalProcessors</td><td>{6}</td></tr><tr><td>PageFilePath</td><td>{7}</td></tr><tr><td>PageFileSize</td><td>{8}</td></tr><tr><td>ComputerBrowser</td><td>{9}</td></tr><tr><td>WindowsUpdate</td><td>{10}</td></tr> <tr><td>SNMP</td><td>{11}</td></tr></table>"@ -fwmiSystem.Name,wmiSystem.Domain, 这篇关于将值传递给powershell中的html标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-21 05:19