Skip to content

Commit

Permalink
Added help for Invoke-ChocoRemoteUpgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
dfranciscus committed May 2, 2019
1 parent 7cbe967 commit 102e18e
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions functions/Invoke-ChocoRemoteUpgrade.ps1
@@ -1,10 +1,28 @@
<#
.SYNOPSIS
Short description
.DESCRIPTION
Long description
Use PowerShell remoting with to remotely update clients by adding and excluding packages. This function uses
Invoke-Command to connect and run choco upgrade for any outdated packages.
.EXAMPLE
Example of how to use this cmdlet
PS C:\Chocotemp> Invoke-ChocoRemoteUpgrade -ComputerName winclient,winclient2 -Credential $DomainCred `
-AdditionalPackages firefox -RebootifPending | Select-Object -Property Name,Result,Computer |
Format-List
Name : googlechrome
Result : Failed
Computer : WINCLIENT2
Name : googlechrome
Result : Failed
Computer : WINCLIENT
Name : firefox
Result : Success
Computer : WINCLIENT2
Name : firefox
Result : Success
Computer : WINCLIENT
.EXAMPLE
Another example of how to use this cmdlet
#>
Expand All @@ -19,7 +37,6 @@ function Invoke-ChocoRemoteUpgrade {
[switch]$RebootifPending
)
process {
#Create dynamic upgrade list
Invoke-Command -ArgumentList $AdditionalPackages,$ExcludedPackages,$ScriptPath,$Credential -ComputerName $ComputerName -ScriptBlock {
param (
$AdditionalPackages,
Expand Down Expand Up @@ -58,7 +75,6 @@ function Invoke-ChocoRemoteUpgrade {
}
}
}
#Restart machines with pending Reboot
if ($RebootifPending){
Test-PendingReboot -ComputerName $ComputerName -SkipConfigurationManagerClientCheck | Where-Object {$_.IsRebootpending -eq $True } | ForEach-Object {
"Rebooting $($_.ComputerName)"
Expand Down

0 comments on commit 102e18e

Please sign in to comment.