Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit 1c7387a

Browse files
authored
Fix test-path failure when retrieving credential provider (#526)
1 parent a3d05c7 commit 1c7387a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Tests/PSGetFindModule.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ Describe "Azure Artifacts Credential Provider Integration" -Tags 'BVT' {
613613
UnRegister-PSRepository -Name $repoName -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
614614
}
615615

616-
it "Register-PackageSource using Visual Studio installed credential provider" -Skip:(!$VSinstalledCredProvider -or !$IsWindows) {
616+
it "Register-PackageSource using Visual Studio installed credential provider" -Skip:(!$VSinstalledCredProvider) {
617617
Register-PSRepository $repoName -SourceLocation $testLocation
618618

619619
(Get-PSRepository -Name $repoName).Name | should match $repoName

src/PowerShellGet/public/psgetfunctions/Get-CredsFromCredentialProvider.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ function Get-CredsFromCredentialProvider {
4343
}
4444
else {
4545
# Option 1b) Find User-location - The NuGet Home location - %UserProfile%/.nuget/plugins/
46-
$path = "`"$env:UserProfile/.nuget/plugins/netcore/CredentialProvider.Microsoft/CredentialProvider.Microsoft.dll`"";
46+
$path = "$($env:UserProfile)/.nuget/plugins/netcore/CredentialProvider.Microsoft/CredentialProvider.Microsoft.dll";
4747

4848
if ($script:IsLinux -or $script:IsMacOS) {
49-
$path = "`"$HOME/.nuget/plugins/netcore/CredentialProvider.Microsoft/CredentialProvider.Microsoft.dll`"";
49+
$path = "$($HOME)/.nuget/plugins/netcore/CredentialProvider.Microsoft/CredentialProvider.Microsoft.dll";
5050
}
5151
if (Test-Path $path -PathType Leaf) {
5252
$credProviderPath = $path
@@ -68,7 +68,7 @@ function Get-CredsFromCredentialProvider {
6868
return $null
6969
}
7070

71-
$vswhereExePath = "`"$programFiles\\Microsoft Visual Studio\\Installer\\vswhere.exe`""
71+
$vswhereExePath = "$($programFiles)\\Microsoft Visual Studio\\Installer\\vswhere.exe"
7272
if (!(Test-Path $vswhereExePath -PathType Leaf)) {
7373
return $null
7474
}

0 commit comments

Comments
 (0)