I’m trying to import a module for use on a dashboard. How do I do this in V3?
I found some documentation suggesting I do this: New-UDEndpointInitialization -Module @("PoshNmap", ".\PoshNmap.psm1")
However, the dashboard won’t start with that bit of code in there.
This module has a function “Invoke-Nmap”, my hope is that a user can type in a remote server to target for NMAP scanning and a table on the page will be updated with the results output by that function. But first I need to import that module!
in p
in ForwardRef
in ForwardRef
in div
in ForwardRef
in ForwardRef
in div
in ForwardRef
in ForwardRef
in ForwardRef
in ForwardRef
in u
in Dashboard
in t
in div
in t
in t
in n
This PowerShell code executes perfectly fine on the same server within ISE:
$Data = @()
$scanData = (invoke-nmap localhost -preset QuickPlus)
foreach($hostEntry in ($scanData | select *)){
foreach($portEntry in $hostEntry.ports){
$Data += @{Hostname = $hostEntry.Hostname; OS = $hostEntry.OS; IPv4 = $hostEntry.IPv4; Protocol = $portEntry.Protocol; Port = $portEntry.Port; Services = $portEntry.Services}
}
}
Here’s how I have it laid out in PS UD:
> $Pages += New-UDPage -Name “Port Testing” -Content {