Open markekraus opened 7 years ago
Code coverage report: Covered 0 % of 53 analyzed Commands in Get-GraphOauthAuthorizationCode Missed commands:
Get-GraphOauthAuthorizationCode
if (-not $pscmdlet.ShouldProcess($Application.ClientID)) { ...
$Client_Id = [System.Web.HttpUtility]::UrlEncode($Application.ClientId)
$Redirect_Uri = [System.Web.HttpUtility]::UrlEncode($Application.RedirectUri)
$Url = "{0}?response_type=code&redirect_uri={1}&client_id={2}" -f @( ...
$BaseURL
$Redirect_Uri
$Client_Id
Write-Verbose "URL: '$URL'"
$Params = @{ ...
TypeName = 'System.Windows.Forms.Form'
Property = @{ ...
Width = 440
Height = 640
$Form = New-Object @Params
TypeName = 'System.Windows.Forms.WebBrowser'
Width = 420
Height = 600
Url = $Url
$Web = New-Object @Params
$DocumentCompleted_Script = { ...
if ($web.Url.AbsoluteUri -match "error=[^&]*...
$form.Close()
$web.ScriptErrorsSuppressed = $false
$web.Add_DocumentCompleted($DocumentCompleted_Script)
$form.Controls.Add($web)
$form.Add_Shown({ $form.Activate() })
$form.Activate()
[void]$form.ShowDialog()
$QueryOutput = [System.Web.HttpUtility]::ParseQueryString($web.Url.Query)
$Response = @{ }
$queryOutput.Keys
$Response["$key"] = $QueryOutput[$key]
$SecAuthCode = 'NOAUTHCODE' ...
$AuthCodeCredential = [pscredential]::new('NOAUTHCODE', $SecAuthCode)
if ($Response.Code) { ...
$SecAuthCode = $Response.Code ...
$AuthCodeCredential = [pscredential]::new('AuthCode', $SecAuthCode)
$Response.Remove('Code')
[pscustomobject]@{ ...
PSTypeName = 'MSGraphAPI.Oauth.AuthorizationCode'
AuthCodeCredential = $AuthCodeCredential
ResultURL = $web.Url.psobject.copy()
Application = $Application
AuthCodeBaseURL = $BaseURL
Response = $Response
Issued = Get-date
[void]$form.Close()
[void]$Web.Dispose()
[void]$Form.Dispose()
Code coverage report: Covered 0 % of 53 analyzed Commands in
Get-GraphOauthAuthorizationCode
Missed commands:if (-not $pscmdlet.ShouldProcess($Application.ClientID)) { ...
$Client_Id = [System.Web.HttpUtility]::UrlEncode($Application.ClientId)
$Redirect_Uri = [System.Web.HttpUtility]::UrlEncode($Application.RedirectUri)
$Url = "{0}?response_type=code&redirect_uri={1}&client_id={2}" -f @( ...
$BaseURL
$Redirect_Uri
$Client_Id
Write-Verbose "URL: '$URL'"
$Params = @{ ...
TypeName = 'System.Windows.Forms.Form'
Property = @{ ...
Width = 440
Height = 640
$Form = New-Object @Params
$Params = @{ ...
TypeName = 'System.Windows.Forms.WebBrowser'
Property = @{ ...
Width = 420
Height = 600
Url = $Url
$Web = New-Object @Params
$DocumentCompleted_Script = { ...
if ($web.Url.AbsoluteUri -match "error=[^&]*...
$form.Close()
$web.ScriptErrorsSuppressed = $false
$web.Add_DocumentCompleted($DocumentCompleted_Script)
$form.Controls.Add($web)
$form.Add_Shown({ $form.Activate() })
$form.Activate()
[void]$form.ShowDialog()
$QueryOutput = [System.Web.HttpUtility]::ParseQueryString($web.Url.Query)
$Response = @{ }
$queryOutput.Keys
$Response["$key"] = $QueryOutput[$key]
$SecAuthCode = 'NOAUTHCODE' ...
$SecAuthCode = 'NOAUTHCODE' ...
$AuthCodeCredential = [pscredential]::new('NOAUTHCODE', $SecAuthCode)
if ($Response.Code) { ...
$SecAuthCode = $Response.Code ...
$SecAuthCode = $Response.Code ...
$AuthCodeCredential = [pscredential]::new('AuthCode', $SecAuthCode)
$Response.Remove('Code')
[pscustomobject]@{ ...
PSTypeName = 'MSGraphAPI.Oauth.AuthorizationCode'
AuthCodeCredential = $AuthCodeCredential
ResultURL = $web.Url.psobject.copy()
Application = $Application
AuthCodeBaseURL = $BaseURL
Response = $Response
Issued = Get-date
[void]$form.Close()
[void]$Web.Dispose()
[void]$Form.Dispose()