tenable / Posh-Nessus

PowerShell Module for automating Tenable Nessus Vulnerability Scanner.
BSD 3-Clause "New" or "Revised" License
88 stars 36 forks source link

new-nessussession parameters. #24

Open danSpotter opened 6 years ago

danSpotter commented 6 years ago

I believe the api has changed. No port required and username/password in json format.

$RestMethodParams = @{ 'Method' = 'Post' 'URI' = "$($URI)/rest/token" 'Body' = @{'username' = $Credentials.UserName; 'password' = $Credentials.GetNetworkCredential().password} | ConvertTo-Json -Compress 'ErrorVariable' = 'NessusLoginError' }

        $TokenResponse = Invoke-RestMethod @RestMethodParams