Open
Description
I try to mock Set-PSRepository
Describe "SetPSRepository" {
Mock Set-PSRepository
It "Should work" {
Set-PSRepository -Name "PSGallery" -InstallationPolicy "Trusted"
}
}
If I run this I get:
[-] Should work 273ms
ValidationMetadataException: The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
ParameterBindingValidationException: Cannot validate argument on parameter 'Location'. The argument is null or empty.
Provide an argument that is not null or empty, and then try the command again.
CmdletInvocationException: Cannot validate argument on parameter 'Location'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
ParameterBindingException: Cannot retrieve the dynamic parameters for the cmdlet. Cannot validate argument on parameter 'Location'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
at <ScriptBlock>,\SetPSRepository.Tests.ps1:
line 5
The Set-PSRepository has no Location
parameter. Why is there a Location in the stack trace?