Functions/Install-AzDoArtifactsCredProvider.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function Install-AzDoArtifactsCredProvider {
 [cmdletbinding()]
 param()

if (-not (Test-Path("$($env:userprofile)/.nuget/plugins/netcore")) -or
    -not (Test-Path("$($env:userprofile)/.nuget/plugins/netfx"))
   ){

    $CredProviderScriptUrl = "https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1"

    $CredScript = Invoke-WebRequest $CredProviderScriptUrl -UseBasicParsing
    $InstallScript = [scriptblock]::create($CredScript.Content)

    &$InstallScript -AddNetFx
   
   }
}