Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sessionstate variable is not being passed correctly in Context.ps1 #1457

Merged
merged 1 commit into from
Feb 19, 2020
Merged

sessionstate variable is not being passed correctly in Context.ps1 #1457

merged 1 commit into from
Feb 19, 2020

Conversation

halvarsson
Copy link

I recently upgraded to the latest version of Pester and while debugging some of my tests were failing with below

New-PesterState : Cannot process argument transformation on parameter 'SessionState'. Cannot convert the "SessionState" value of type "System.String" to type "System.Management.Automation.SessionState".
At C:\Program Files\WindowsPowerShell\Modules\pester\4.10.1\Functions\Context.ps1:88 char:128
... '] .) -TestNameFilter $null -TagFilter @() -SessionState SessionState

It seems that a bug was introduced with Session state hints (#1169) in the change to Context.ps1 ( d25ff9f#diff-d4fc7a10c374cf6c159f443304feb3e4)

@nohwnd nohwnd merged commit dece2a8 into pester:master Feb 19, 2020
@nohwnd
Copy link
Member

nohwnd commented Feb 19, 2020

Thanks! I guess this only reproduces when you use Context as top level block and run interactively? That is why no-one noticed for such a long while. 😊

@halvarsson
Copy link
Author

Thanks for the quick merge :) yep exactly, I was building a context/it block builder function for some data structures when I ran into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants