1"use strict";(self.webpackChunkpester_docs=self.webpackChunkpester_docs||[]).push([["6597"],{5547(e,n,t){t.r(n),t.d(n,{metadata:()=>r,default:()=>p,frontMatter:()=>i,contentTitle:()=>l,toc:()=>c,assets:()=>a});var r=JSON.parse('{"id":"commands/ConvertTo-NUnitReport","title":"ConvertTo-NUnitReport","description":"Help for Pester command \'ConvertTo-NUnitReport\'. Converts a Pester result-object to an NUnit 2.5 or 3-compatible XML-report","source":"@site/versioned_docs/version-v5/commands/ConvertTo-NUnitReport.mdx","sourceDirName":"commands","slug":"/commands/ConvertTo-NUnitReport","permalink":"/docs/v5/commands/ConvertTo-NUnitReport","draft":false,"unlisted":false,"editUrl":null,"tags":[],"version":"v5","frontMatter":{"id":"ConvertTo-NUnitReport","title":"ConvertTo-NUnitReport","description":"Help for Pester command \'ConvertTo-NUnitReport\'. Converts a Pester result-object to an NUnit 2.5 or 3-compatible XML-report","keywords":["PowerShell","Pester","Help","Documentation"],"hide_title":false,"hide_table_of_contents":false,"custom_edit_url":null},"sidebar":"commands","previous":{"title":"ConvertTo-JUnitReport","permalink":"/docs/v5/commands/ConvertTo-JUnitReport"},"next":{"title":"ConvertTo-Pester4Result","permalink":"/docs/v5/commands/ConvertTo-Pester4Result"}}'),s=t(1987),o=t(7008);let i={id:"ConvertTo-NUnitReport",title:"ConvertTo-NUnitReport",description:"Help for Pester command 'ConvertTo-NUnitReport'. Converts a Pester result-object to an NUnit 2.5 or 3-compatible XML-report",keywords:["PowerShell","Pester","Help","Documentation"],hide_title:!1,hide_table_of_contents:!1,custom_edit_url:null},l,a={},c=[{value:"SYNOPSIS",id:"synopsis",level:2},{value:"SYNTAX",id:"syntax",level:2},{value:"DESCRIPTION",id:"description",level:2},{value:"EXAMPLES",id:"examples",level:2},{value:"EXAMPLE 1",id:"example-1",level:3},{value:"EXAMPLE 2",id:"example-2",level:3},{value:"EXAMPLE 3",id:"example-3",level:3},{value:"PARAMETERS",id:"parameters",level:2},{value:"-AsString",id:"-asstring",level:3},{value:"-Format",id:"-format",level:3},{value:"-Result",id:"-result",level:3},{value:"CommonParameters",id:"commonparameters",level:3},{value:"INPUTS",id:"inputs",level:2},{value:"Pester.Run",id:"pesterrun",level:3},{value:"OUTPUTS",id:"outputs",level:2},{value:"NOTES",id:"notes",level:2},{value:"RELATED LINKS",id:"related-links",level:2},{value:"VERSION",id:"version",level:2}];function d(e){let n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.admonition,{title:"This page was generated",type:"info",children:(0,s.jsxs)(n.p,{children:["Contributions are welcome in ",(0,s.jsx)(n.a,{href:"https://github.com/pester/Pester/tree/rel/5.x.x",children:"Pester v5-repo"}),"."]})}),"\n",(0,s.jsx)(n.h2,{id:"synopsis",children:"SYNOPSIS"}),"\n",(0,s.jsx)(n.p,{children:"Converts a Pester result-object to an NUnit 2.5 or 3-compatible XML-report"}),"\n",(0,s.jsx)(n.h2,{id:"syntax",children:"SYNTAX"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-powershell",children:"ConvertTo-NUnitReport [-Result] <Run> [[-Format] <string>] [-AsString]\n"})}),"\n",(0,s.jsx)(n.h2,{id:"description",children:"DESCRIPTION"}),"\n",(0,s.jsx)(n.p,{children:"Pester can generate a result-object containing information about all\ntests that are processed in a run.\nThis objects can then be c
1onverted to an\nNUnit-compatible XML-report using this function.\nThe report is generated\nusing either the NUnit 2.5 or 3-schema."}),"\n",(0,s.jsx)(n.p,{children:"The function can convert to both XML-object or a string containing the XML.\nThis can be useful for further processing or publishing of test results,\ne.g.\nas part of a CI/CD pipeline."}),"\n",(0,s.jsx)(n.h2,{id:"examples",children:"EXAMPLES"}),"\n",(0,s.jsx)(n.h3,{id:"example-1",children:"EXAMPLE 1"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-powershell",children:"$p = Invoke-Pester -Passthru\n$p | ConvertTo-NUnitReport\n"})}),"\n",(0,s.jsx)(n.p,{children:"This example runs Pester using the Passthru option to retrieve the result-object and\nconverts it to an NUnit 2.5-compatible XML-report.\nThe report is returned as an XML-object."}),"\n",(0,s.jsx)(n.h3,{id:"example-2",children:"EXAMPLE 2"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-powershell",children:"$p = Invoke-Pester -Passthru\n$p | ConvertTo-NUnitReport -Format NUnit3\n"})}),"\n",(0,s.jsx)(n.p,{children:"This example runs Pester using the Passthru option to retrieve the result-object and\nconverts it to an NUnit 3-compatible XML-report.\nThe report is returned as an XML-object."}),"\n",(0,s.jsx)(n.h3,{id:"example-3",children:"EXAMPLE 3"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-powershell",children:"$p = Invoke-Pester -Passthru\n$p | ConvertTo-NUnitReport -AsString\n"})}),"\n",(0,s.jsx)(n.p,{children:"This example runs Pester using the Passthru option to retrieve the result-object and\nconverts it to an NUnit 2.5-compatible XML-report.\nThe returned object is a string."}),"\n",(0,s.jsx)(n.h2,{id:"parameters",children:"PARAMETERS"}),"\n",(0,s.jsx)(n.h3,{id:"-asstring",children:"-AsString"}),"\n",(0,s.jsx)(n.p,{children:"Returns the XML-report as a string."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yaml",children:"Type: System.Management.Automation.SwitchParameter\nDefaultValue: False\nSupportsWildcards: false\nAliases: []\nParameterSets:\n- Name: (All)\n Position: Named\n IsRequired: false\n ValueFromPipeline: false\n ValueFromPipelineByPropertyName: false\n ValueFromRemainingArguments: false\nDontShow: false\nAcceptedValues: []\nHelpMessage: ''\n"})}),"\n",(0,s.jsx)(n.h3,{id:"-format",children:"-Format"}),"\n",(0,s.jsx)(n.p,{children:"Specifies the NUnit-schema to be used."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yaml",children:"Type: System.String\nDefaultValue: NUnit2.5\nSupportsWildcards: false\nAliases: []\nParameterSets:\n- Name: (All)\n Position: 1\n IsRequired: false\n ValueFromPipeline: false\n ValueFromPipelineByPropertyName: false\n ValueFromRemainingArguments: false\nDontShow: false\nAcceptedValues: []\nHelpMessage: ''\n"})}),"\n",(0,s.jsx)(n.h3,{id:"-result",children:"-Result"}),"\n",(0,s.jsx)(n.p,{children:"Result object from a Pester-run.\nThis can be retrieved using Invoke-Pester\n-Passthru or by using the Run.PassThru configuration-option."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yaml",children:"Type: Pester.Run\nDefaultValue: ''\nSupportsWildcards: false\nAliases: []\nParameterSets:\n- Name: (All)\n Position: 0\n IsRequired: true\n ValueFromPipeline: true\n ValueFromPipelineByPropertyName: false\n ValueFromRemainingArguments: false\nDontShow: false\nAcceptedValues: []\nHelpMessage: ''\n"})}),"\n",(0,s.jsx)(n.h3,{id:"commonparameters",children:"CommonParameters"}),"\n",(0,s.jsxs)(n.p,{children:["This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,\n-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,\n-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see\n",(0,s.jsx)(n.a,{href:"https://go.microsoft.com/fwlink/?LinkID=113216",children:"about_CommonParameters"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"inputs",children:"INPUTS"}),"\n",(0,s.jsx)(n.h3,{id:"pesterrun",children:"Pester.Run"}),"\n",(0,s.jsx)(n.h2,{id:"outputs",children:"OUTPUTS"}),"\n",(0,s.jsx)(n.h2,{id:"notes",children:"NOTES"}),"\n",(0,s.jsx)(n.h2,{id:"related-links",children:"RELATED LINKS"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://pester.dev/docs/v5/commands/ConvertTo-NUnitReport",children:"https://pester.dev/docs/v5/commands/ConvertTo-NUnitReport"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://pester.dev/docs/v5/commands/Invoke-Pester",children:"https://pester.dev/docs/v5/commands/Invoke-Pester"})}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"version",children:"VERSION"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.em,{children:["This page was generated using comment-based help in ",(0,s.jsx)(n.a,{href:"https://github.com/pester/Pester/tree/rel/5.x.x",children:"Pester 5.9.1"}),"."]})})]})}function p(e={}){let{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},7008(e,n,t){t.d(n,{R:()=>i,x:()=>l});var r=t(1763);let s={},o=r.createContext(s);function i(e){let n=r.useContext(o);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(o.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.