We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 26ca87c commit 077c707Copy full SHA for 077c707
Modules/Scripts/Install-Chocolatey.ps1
@@ -3,11 +3,11 @@
3
Can be used on new machines to install Chocolately. If already installed then
4
checks if it is outdated and prompts to update.
5
6
-.PARAMETER -Yes
7
-Upgrade without prompting if an update is available.
+.PARAMETER Upgrade
+Check if Chocolatey is outdated and update if it is.
8
#>
9
10
-param ([switch] $Yes)
+param ([switch] $Upgrade)
11
12
if (-not (Get-Command 'choco' -ErrorAction:Ignore))
13
{
@@ -26,13 +26,10 @@ if (-not (Get-Command 'choco' -ErrorAction:Ignore))
26
Write-Host 'Install'
27
Invoke-Expression $installer
28
}
29
-else
+elseif ($Upgrade)
30
31
- choco outdated -r
32
-
33
- # TODO: react...
34
- if ($Yes)
+ (choco outdated -r) | % { $_ -match 'chocolatey\|'} | % `
35
36
- # blah...
+ choco upgrade chocolatey -y
37
38
0 commit comments