Skip to content

Instantly share code, notes, and snippets.

Created January 17, 2016 20:03
Show Gist options
  • Save anonymous/45419c70419074381e3f to your computer and use it in GitHub Desktop.
Save anonymous/45419c70419074381e3f to your computer and use it in GitHub Desktop.
param
(
[string]$xmlpath="myscan.xml",
[string]$respath="result.html"
)
$hash = @{}
[xml]$data = Get-Content $xmlpath
foreach( $host1 in $data.nmaprun.host )
{
if( $host1.ports.port.script )
{
$hash.Add( $host1.address.addr, "ftp://"+$host1.address.addr )
}
}
Function MyFunction
{
$hash.GetEnumerator() | ConvertTo-HTML -Property @{Label="FTP";Expression={"<a href='$($_.Value)'>$($_.Name)</a>"}}
}
$html = MyFunction
Add-Type -AssemblyName System.Web
[System.Web.HttpUtility]::HtmlDecode($html) | Out-File $respath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment