Added comment-based help

This commit is contained in:
Dan Franciscus
2019-05-01 12:31:21 -07:00
parent 0b73f3c352
commit aa317d548d
3 changed files with 28 additions and 8 deletions

View File

@@ -4,8 +4,11 @@
PowerShell module for managing Chocolatey internalizing and remote upgrading of client packages
Authored by Dan Franciscus
## Examples - https://github.com/dfranciscus/Chocolatey-tools/tree/master/Examples
## Installing
The easiest way to get Chocolatey-tools is using the [PowerShell Gallery](https://powershellgallery.com/packages/Chocolatey-tools/)!

View File

@@ -1,12 +1,17 @@
<#
.SYNOPSIS
Short description
Find outdated packages from a local machine
.DESCRIPTION
Long description
Wrapper around choco outdated -r. Ignores pinned and unfound packages from sources
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
PS C:\> Get-ChocoOutdatedPackages
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 {
[CmdletBinding()]

View File

@@ -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 {
[CmdletBinding()]
param(
@@ -12,7 +27,6 @@ function Invoke-BoxStarterRemoteUpgrade {
[switch]$Parallel
)
#Create dynamic upgrade list
Invoke-Command -ArgumentList $AdditionalPackages,$ExcludedPackages,$ScriptPath -ComputerName $ComputerName -ScriptBlock {
param (
$AdditionalPackages,
@@ -39,12 +53,10 @@ function Invoke-BoxStarterRemoteUpgrade {
Add-Content $ScriptPath -Value "choco upgrade $_ -r -y --timeout=600"
}
}
#Upgrade computers with Boxstarter
if (!$Parallel){
Install-BoxstarterPackage -ComputerName $ComputerName -PackageName $ScriptPath -DelegateChocoSources
}
else {
#Upgrade computers in parallel with Boxstarter
$ComputerName | ForEach-Object {
start-process -RedirectStandardOutput C:\Windows\Temp\$_.txt -FilePath powershell -ArgumentList "-windowstyle hidden Install-BoxstarterPackage -ComputerName $_ -PackageName $ScriptPath" -PassThru
}