jwmoss / PSTenable

A PowerShell wrapper around Tenable Security Center API
MIT License
1 stars 0 forks source link

Examples on Front page of Github has typo #11

Closed AaronG1234 closed 5 years ago

AaronG1234 commented 5 years ago

Expected Behavior

Cache credentials, tenable server, web session, and token.

$Credential = Get-Credential Connect-PSTenable -Credential $Credential -TenableServer "server.domain.com/rest" -Register

Should return nothing, (but have cached a tenable rest api token for future calls)

Current Behavior

PS H:> Connect-PSTenable -Credential $creds -TenableServer "securitycenter.xxxx.xxx/rest" -Register Invoke-RestMethod : Unable to connect to the remote server At \pnas02fs2\Home\XXXX\WindowsPowerShell\Modules\PSTenable\0.2.3\public\Connect-PSTenable.ps1:72 char:20

Possible Solution

Change the Example to read

Cache credentials, tenable server, web session, and token.

$Credential = Get-Credential Connect-PSTenable -Credential $Credential -TenableServer "https://server.domain.com/rest" -Register

OR

update code to prepend 'https://' if the tenable server argument does not have :// in it.

Steps to Reproduce (for bugs)

Single step, so just review the above unexpected result.

Context

I had to read your code ... I was traumatized... just kidding, Im satisfied, just caused frustration

Your Environment

jwmoss commented 5 years ago

Well that's embarrassing. Let me update that!