Pester OVF parameters

Tagged: ,

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of Tim Ker Tim Ker 5 months, 3 weeks ago.

  • Author
    Posts
  • #42964
    Profile photo of Tim Ker
    Tim Ker
    Participant

    Is is possible to pass parmaters into OVF? Or does anyone have simlar issues?

    The needs is to test different servers, verify each one before going live.

    Currenly I'm hacking it by setting a global Variable before calling Invoke-OperationValidation

    
    $UrlOverride = Get-Variable UrlOverride -Scope Global  -ValueOnly -ErrorAction SilentlyContinue
    if ($UrlOverride -ne $null) 
    {
            $Url = $Global:UrlOverride 
    }
    

    which works, but is far from ideal

  • #42994
    Profile photo of Jonathan Warnken
    Jonathan Warnken
    Participant

    My experience has been that you need to do what you have done by setting a variable in the test that gets updated before calling the test or have the test read a config file that contains the variable value(s) and you have to update the file before calling the test.

  • #43026
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    Looks like someone has proposed this already: https://github.com/PowerShell/Operation-Validation-Framework/issues/6

    Pester supports it already, but not sure about OVF. (Presumably not, or that issue wouldn't exist.)

  • #43515
    Profile photo of Tim Ker
    Tim Ker
    Participant

    thanks,
    I totally missed/misunderstood the -Script parameter in Pester
    https://github.com/pester/Pester/wiki/Invoke-Pester

You must be logged in to reply to this topic.