Added comment-based help
This commit is contained in:
@@ -4,8 +4,11 @@
|
|||||||
|
|
||||||
PowerShell module for managing Chocolatey internalizing and remote upgrading of client packages
|
PowerShell module for managing Chocolatey internalizing and remote upgrading of client packages
|
||||||
|
|
||||||
|
|
||||||
Authored by Dan Franciscus
|
Authored by Dan Franciscus
|
||||||
|
|
||||||
|
## Examples - https://github.com/dfranciscus/Chocolatey-tools/tree/master/Examples
|
||||||
|
|
||||||
## Installing
|
## Installing
|
||||||
|
|
||||||
The easiest way to get Chocolatey-tools is using the [PowerShell Gallery](https://powershellgallery.com/packages/Chocolatey-tools/)!
|
The easiest way to get Chocolatey-tools is using the [PowerShell Gallery](https://powershellgallery.com/packages/Chocolatey-tools/)!
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Short description
|
Find outdated packages from a local machine
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
Long description
|
Wrapper around choco outdated -r. Ignores pinned and unfound packages from sources
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Example of how to use this cmdlet
|
PS C:\> Get-ChocoOutdatedPackages
|
||||||
.EXAMPLE
|
|
||||||
Another example of how to use this cmdlet
|
Name CurrentVersion Version Pinned
|
||||||
|
---- -------------- ------- ------
|
||||||
|
chocolatey.extension 2.0.1 2.0.2 false
|
||||||
|
curl 7.64.0 7.64.1 false
|
||||||
|
GoogleChrome 73.0.3683.103 74.0.3729.131 false
|
||||||
|
|
||||||
#>
|
#>
|
||||||
function Get-ChocoOutdatedPackages {
|
function Get-ChocoOutdatedPackages {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
|
|||||||
@@ -1,3 +1,18 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Uses Install-Boxstarterpackage to install packages remotely. In addition, provides ability to deploy new packages and exclude packages.
|
||||||
|
.DESCRIPTION
|
||||||
|
Long description
|
||||||
|
.EXAMPLE
|
||||||
|
Here, we upgrade any out of date packages on winclient2, push out curl and git packages and exclude jre8 from updating.
|
||||||
|
Each of these commands is created dynamically at runtime on a text file on the local machine called Boxstarterupgrade.txt
|
||||||
|
|
||||||
|
Invoke-BoxStarterRemoteUpgrade -ComputerName winclient2 -Credential $DomainCred -AdditionalPackages curl,git -ExcludedPackages jre8 -ScriptPath C:\Windows\Temp\BoxstarterUpgrade.txt
|
||||||
|
.EXAMPLE
|
||||||
|
Here we use the -Parallel switch so that each remote machine is processed at the same time.
|
||||||
|
|
||||||
|
Invoke-BoxStarterRemoteUpgrade -ComputerName winclient2 -Credential $DomainCred -AdditionalPackages curl,git -Parallel -ScriptPath C:\Windows\Temp\BoxstarterUpgrade.txt
|
||||||
|
#>
|
||||||
function Invoke-BoxStarterRemoteUpgrade {
|
function Invoke-BoxStarterRemoteUpgrade {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
param(
|
param(
|
||||||
@@ -12,7 +27,6 @@ function Invoke-BoxStarterRemoteUpgrade {
|
|||||||
[switch]$Parallel
|
[switch]$Parallel
|
||||||
)
|
)
|
||||||
|
|
||||||
#Create dynamic upgrade list
|
|
||||||
Invoke-Command -ArgumentList $AdditionalPackages,$ExcludedPackages,$ScriptPath -ComputerName $ComputerName -ScriptBlock {
|
Invoke-Command -ArgumentList $AdditionalPackages,$ExcludedPackages,$ScriptPath -ComputerName $ComputerName -ScriptBlock {
|
||||||
param (
|
param (
|
||||||
$AdditionalPackages,
|
$AdditionalPackages,
|
||||||
@@ -39,12 +53,10 @@ function Invoke-BoxStarterRemoteUpgrade {
|
|||||||
Add-Content $ScriptPath -Value "choco upgrade $_ -r -y --timeout=600"
|
Add-Content $ScriptPath -Value "choco upgrade $_ -r -y --timeout=600"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#Upgrade computers with Boxstarter
|
|
||||||
if (!$Parallel){
|
if (!$Parallel){
|
||||||
Install-BoxstarterPackage -ComputerName $ComputerName -PackageName $ScriptPath -DelegateChocoSources
|
Install-BoxstarterPackage -ComputerName $ComputerName -PackageName $ScriptPath -DelegateChocoSources
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#Upgrade computers in parallel with Boxstarter
|
|
||||||
$ComputerName | ForEach-Object {
|
$ComputerName | ForEach-Object {
|
||||||
start-process -RedirectStandardOutput C:\Windows\Temp\$_.txt -FilePath powershell -ArgumentList "-windowstyle hidden Install-BoxstarterPackage -ComputerName $_ -PackageName $ScriptPath" -PassThru
|
start-process -RedirectStandardOutput C:\Windows\Temp\$_.txt -FilePath powershell -ArgumentList "-windowstyle hidden Install-BoxstarterPackage -ComputerName $_ -PackageName $ScriptPath" -PassThru
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user