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

Fix test path failure when retrieving credential provider #526

Merged
merged 2 commits into from
Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tests/PSGetFindModule.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ Describe "Azure Artifacts Credential Provider Integration" -Tags 'BVT' {
UnRegister-PSRepository -Name $repoName -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
}

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

(Get-PSRepository -Name $repoName).Name | should match $repoName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ function Get-CredsFromCredentialProvider {
}
else {
# Option 1b) Find User-location - The NuGet Home location - %UserProfile%/.nuget/plugins/
$path = "`"$env:UserProfile/.nuget/plugins/netcore/CredentialProvider.Microsoft/CredentialProvider.Microsoft.dll`"";
$path = "$($env:UserProfile)/.nuget/plugins/netcore/CredentialProvider.Microsoft/CredentialProvider.Microsoft.dll";

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

$vswhereExePath = "`"$programFiles\\Microsoft Visual Studio\\Installer\\vswhere.exe`""
$vswhereExePath = "$($programFiles)\\Microsoft Visual Studio\\Installer\\vswhere.exe"
if (!(Test-Path $vswhereExePath -PathType Leaf)) {
return $null
}
Expand Down