Comments (3)
Hi. This is intended PowerShell behavior and not exclusive to Peater. When you use [Parameter()]
or [CmdletBinding()]
it becomes an advanced function/script. Arguments are then disabled by default so if you try to splat or call with an undefined parameter it will throw.
You need to provide Data compatible with every script or use multiple calls to New-PesterContainer
with the appropriate Data values per script.
from pester.
@GSDragoon does it work to use ValueFromRemainingArguments
?
from pester.
Hi. This is intended PowerShell behavior and not exclusive to Peater. When you use
[Parameter()]
or[CmdletBinding()]
it becomes an advanced function/script. Arguments are then disabled by default so if you try to splat or call with an undefined parameter it will throw.You need to provide Data compatible with every script or use multiple calls to
New-PesterContainer
with the appropriate Data values per script.
Thanks for the quick response. Guess I shouldn't be too surprised this is the case. Sounds like I need to be okay with a workaround or make bigger design changes
@GSDragoon does it work to use
ValueFromRemainingArguments
?
Yes, this works. Suppose this is another workaround, to add this parameter to each file.
param (
[Parameter()]
[string] $Parameter1,
[Parameter(ValueFromRemainingArguments)]
[object[]]$RemainingParametersPlaceholder
)
from pester.
Related Issues (20)
- CodeCoverage.OutputEncoding ignored in xml encoding-attribute
- Invoke-Pester breaks on invalid CodeCoverage.OutputEncoding format
- TestResults.OutputEncoding option ignored
- Pester Should -Invoke -Scope "It" not working as expected HOT 1
- SkipRemainingOnFailure does not trigger on block failure
- Update how test registry entry is generated
- Improve Should-BeString assertion
- Fix Should-*Collection and their tests
- Make sure new assertion docs are in showing up on pester.dev
- Export Should-Invoke and Should-HaveParameter
- Output should result to Assert assertions
- Add soft assertions to new assertions
- Expose GlobalPluginData to all plugin steps
- Infinite loop for `FileInfo` and `DirectoryInfo` due to `Root` properties in `DirectoryInfo`. Should we restrict depth as a general fix in addition to specialcasing `DirectoryInfo` in `Get-DisplayProperty2`? HOT 1
- Measure Code Coverage for Pester
- `Get-Help Should-Be` will still show `Assert-Be`. We'll also need to modify `generate-command-reference.ps1` in docs-repo to rename files and title to match alias.
- `Get-EquivalencyOption` is not exposed, so unable to customize/no docs on expected hashtable. HOT 2
- Inconsistent behavior mocking external command between output verbosity 'Detailed' and 'Diagnostic' HOT 3
- Calling mock of Get-ChildItem with -File parameter fails on Linux
- Does Pester support to view the code coverage report in browser? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pester.