From 7743fae6c4796237f7ecbfba65cfea3a597608a5 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 11 Aug 2024 20:16:22 +0200 Subject: [PATCH] test --- tests/GitHub.Tests.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/GitHub.Tests.ps1 b/tests/GitHub.Tests.ps1 index ee34147e..609cda90 100644 --- a/tests/GitHub.Tests.ps1 +++ b/tests/GitHub.Tests.ps1 @@ -23,10 +23,13 @@ Describe 'GitHub' { 'X-GitHub-Api-Version' = Get-GitHubConfig -Name ApiVersion } + $encryptedString = $AccessToken | ConvertFrom-SecureString + $secureStringRecovered = $encryptedString | ConvertTo-SecureString + $token = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($secureStringRecovered)) + $AccessToken = Get-GitHubConfig -Name AccessToken if ($AccessToken) { - $Token = $AccessToken | ConvertFrom-SecureString -AsPlainText - $headers['Authorization'] = "Bearer $Token" + $headers['Authorization'] = "Bearer $token" } Remove-HashtableEntry -Hashtable $headers -NullOrEmptyValues