When mocking Copy-Item the dynamic parameters ToSession and FromSession are not available
2. Describe Your Environment
Pester version : 4.4.2 C:\Users\ryan.bartram\OneDrive - itnetx AG\Documents\WindowsPowerShell\Modules\Pester\4.4.2\Pester.psd1
PowerShell version : 5.1.17134.228
OS version : Microsoft Windows NT 10.0.17134.0
3. Expected Behavior
Pester should find the dynamic params and include them in the generated mock
4.Current Behavior
The two parameters in question are missing and it leads to the function failing and claiming that copy-item does not have parameters tosession or fromsession
5. Possible Solution
in Mock.ps1 line 1394, change the current method of retrieving the cmdlet definition with Get-Command. Don't ask me what the difference is in these two method calls but Get-Command returns the dynamic params and the $ExecutionContext.InvokeCommand.GetCommand does not. I have also tried with the 'old' pre PS 5.0 block and it fails there also.
6. Context
I am unable to mock a function that makes a call to Copy-Item using the ToSession and/or FromSession parameters
1. General summary of the issue
When mocking Copy-Item the dynamic parameters ToSession and FromSession are not available
2. Describe Your Environment
Pester version : 4.4.2 C:\Users\ryan.bartram\OneDrive - itnetx AG\Documents\WindowsPowerShell\Modules\Pester\4.4.2\Pester.psd1 PowerShell version : 5.1.17134.228 OS version : Microsoft Windows NT 10.0.17134.0
3. Expected Behavior
Pester should find the dynamic params and include them in the generated mock
4.Current Behavior
The two parameters in question are missing and it leads to the function failing and claiming that copy-item does not have parameters tosession or fromsession
5. Possible Solution
in Mock.ps1 line 1394, change the current method of retrieving the cmdlet definition with Get-Command. Don't ask me what the difference is in these two method calls but Get-Command returns the dynamic params and the $ExecutionContext.InvokeCommand.GetCommand does not. I have also tried with the 'old' pre PS 5.0 block and it fails there also.
6. Context
I am unable to mock a function that makes a call to Copy-Item using the ToSession and/or FromSession parameters