Skip to content

Commit

Permalink
add nuget script
Browse files Browse the repository at this point in the history
  • Loading branch information
willtome committed Oct 2, 2023
1 parent eb5d9be commit 1a002e5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions windows/Install-NuGet.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
if($null -eq $Ansible){
$Ansible = @{}
}

$pProv=Get-PackageProvider | Where-Object{$_.Name -eq "NuGet"}

if($null -ne $pProv){
$Ansible.Changed = $false
# OK
return
}
else{
$pProv=$null
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
$Ansible.Changed = $true
$pProv=Get-PackageProvider | Where-Object{$_.Name -eq "NuGet"}
if($null -ne $pProv){
# OK
}
else{
$Ansible.Failed=$true
}
}

0 comments on commit 1a002e5

Please sign in to comment.