Why does Pester dynamically create a "temp" command, save it to "$TestDrive\temp.ps1", dotsource it, and then invoke the "temp" command?
Why not just directly invoke the scriptblock used to create the "temp" command? Could doing so remove the need for having a TestDrive? Also, why is there a TestDrive?
My needs for Pester don't cover this, and I'm just wondering what the use cases are.
(I'm referring to the code in It.ps1)
Edit: I found the wiki for the TestDrive. My original question remains, however. What value does temp.ps1 provide?
Why does Pester dynamically create a "temp" command, save it to "$TestDrive\temp.ps1", dotsource it, and then invoke the "temp" command?
Why not just directly invoke the scriptblock used to create the "temp" command?
Could doing so remove the need for having a TestDrive? Also, why is there a TestDrive?My needs for Pester don't cover this, and I'm just wondering what the use cases are.
(I'm referring to the code in It.ps1)
Edit: I found the wiki for the TestDrive. My original question remains, however. What value does temp.ps1 provide?