Skip to content

Commit

Permalink
Support for empty params and install arguments (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanbergstrom committed Sep 24, 2021
1 parent 7266ace commit f04fbbf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.8] - 2021-09-24
#### Added
* Support for empty package parameters and install arguments

## [0.0.7] - 2021-07-11
#### Added
* Specific Cmdlet descriptions in Get-Help documentation
Expand Down
6 changes: 4 additions & 2 deletions src/Foil.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,10 @@ $Commands = @(
},
@{
Name = 'Parameters'
OriginalName = '--parameters'
OriginalName = '--parameters='
ParameterType = 'string'
Description = 'Parameters to pass to the package'
NoGap = $true
},
@{
Name = 'ArgsGlobal'
Expand All @@ -162,9 +163,10 @@ $Commands = @(
},
@{
Name = 'InstallArguments'
OriginalName = '--install-arguments'
OriginalName = '--install-arguments='
ParameterType = 'string'
Description = 'Parameters to pass to the package'
NoGap = $true
},
@{
Name = 'Source'
Expand Down
12 changes: 12 additions & 0 deletions test/Foil.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ Describe "pipline-based package installation and uninstallation" {
Get-ChocoPackage -Name $package -LocalOnly -Exact | Uninstall-ChocoPackage | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
}
Context 'with empty arguments' {
BeforeAll {
$package = 'cpu-z'
}

It 'searches for and silently installs the latest version of a package' {
Get-ChocoPackage -Name $package | Install-ChocoPackage -Force -Parameters '' | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
It 'finds and silently uninstalls the locally installed package just installed' {
Get-ChocoPackage -Name $package -LocalOnly -Exact | Uninstall-ChocoPackage | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
}
Context 'with additional parameters' {
BeforeAll {
$package = 'sysinternals'
Expand Down

0 comments on commit f04fbbf

Please sign in to comment.