Created
February 1, 2016 00:22
-
-
Save MSAdministrator/e3eb330e540d21f32cd2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Test-QualysAuthentication () | |
{ | |
[cmdletbinding()] | |
param ( | |
[parameter(Mandatory=$true, | |
ValueFromPipelineByPropertyName=$true, | |
HelpMessage="Please provide a credential obejct")] | |
[ValidateNotNullOrEmpty()] | |
[System.Management.Automation.CredentialAttribute()]$credential | |
) | |
<# | |
.SYNOPSIS | |
This function tests your Qualys VM API Credentials | |
.PARAMETER Credential | |
Specifices a set of credentials used to query the QualysGuard API | |
.EXAMPLE | |
C:\PS> $cred = Get-Credential | |
C:\PS> Test-QualysAuthentication -credential $cred | |
#> | |
[xml]$hostinfo = Invoke-RestMethod -Uri "https://qualysapi.qualys.com/msp/get_host_info.php?host_netbios=$netbios&general_info=1" -Credential $credential | |
return $hostinfo | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment