28 lines
761 B
PowerShell
28 lines
761 B
PowerShell
function Invoke-UpdateChrome {
|
|
<#
|
|
.SYNOPSIS
|
|
Upgrade Chrome on the given servers using the internally managed Choco package GoogleChrome
|
|
.PARAMETER ComputerName
|
|
List of servers to run the upgrade on
|
|
.PARAMETER WhatIf
|
|
Safety valve
|
|
#>
|
|
[CmdletBinding()]
|
|
[OutputType([System.Void])]
|
|
param(
|
|
[Parameter(Mandatory = $true)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[string[]]$ComputerName,
|
|
[Parameter(Mandatory = $false)]
|
|
[switch]$WhatIf
|
|
)
|
|
$sbChrome = {
|
|
choco upgrade -y GoogleChrome
|
|
}
|
|
if ($WhatIf) {
|
|
Write-Host "Calling Invoke-Command -ComputerName $ComputerName -ScriptBlock $sbChrome"
|
|
} else {
|
|
Invoke-Command -ComputerName $ComputerName -ScriptBlock $sbChrome
|
|
}
|
|
}
|