mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-18 02:37:43 -06:00
Add Extra Guards/Checks in 'Install-WinUtilProgramChoco' Private Function
This commit is contained in:
parent
e69048a7a0
commit
782fca962e
@ -14,13 +14,21 @@ function Install-WinUtilProgramChoco {
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
param(
|
param(
|
||||||
$ProgramsToInstall,
|
[Parameter(Mandatory, Position=0)]
|
||||||
$manage = "Installing"
|
[PsCustomObject]$ProgramsToInstall,
|
||||||
|
|
||||||
|
[Parameter(Mandatory, Position=1)]
|
||||||
|
[String]$manage = "Installing"
|
||||||
)
|
)
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
$count = $ProgramsToInstall.Count
|
$count = $ProgramsToInstall.Count
|
||||||
|
|
||||||
|
# This check isn't really necessary, as there's a couple of checks before this Private Function gets called, but just to make sure ;)
|
||||||
|
if($count -le 0) {
|
||||||
|
throw "Private Function 'Install-WinUtilProgramChoco' expected Parameter 'ProgramsToInstall' to be of size 1 or greater, instead got $count,`nPlease double check your code and re-compile WinUtil."
|
||||||
|
}
|
||||||
|
|
||||||
Write-Progress -Activity "$manage Applications" -Status "Starting" -PercentComplete 0
|
Write-Progress -Activity "$manage Applications" -Status "Starting" -PercentComplete 0
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
Write-Host "-- insstalling Chocolatey pacakages ---"
|
Write-Host "-- insstalling Chocolatey pacakages ---"
|
||||||
|
Loading…
Reference in New Issue
Block a user