I have searched for an answer to this and have not found something that has worked for me yet.
I have a Powershell script that is being used in Tripwire to assess the IIS version of a server. The value is returned, but it can't be interpreted by Tripwire because of blank lines, I believe.
Kindly see the code below. Thank you in advance!
%Windir%\system32\WindowsPowerShell\v1.0\powershell.exe "$ErrorActionPreference='SilentlyContinue'; $iv=(get-itemproperty HKLM:\SOFTWARE\Microsoft\InetStp\ | select setupstring | ft -hidetableheaders); if ($iv.length -gt 0 | where {$_.versionstring -ne ""} ) { echo $iv } else { Write-Host -NoNewline "Not Installed" }"