Closed vijayrkn closed 8 years ago
How are tests passing then?
Invoking the scripts from VS was failing. Not the tests. I have made the changes in VS to pass the pubProfilePath for now. Once this issue is fixed, will revert the change in VS.
So it's the bug in vs or in the script/module?
The bug is in the module. PubProfilePath has a notnull check. This check needs to be removed. I can make this change. Will also add a test to test this scenario.
@vijayrkn OK thanks, i see it now. I was just trying to make sure that I understood why it's failing in VS but not the command line. From the command line the validate checks are only invoked if the -pubProfilePath
parameter is passed. From VS I'm guessing that you always pass it and sometimes the value is null.
From VS it is failing even if I am not passing the parameter at all -pubProfilePath.
Cannot validate argument on parameter 'pubProfilePath'. The argument is null, empty, or an element of the argument collection contains a null value. Supply a collection that does not contain any null values and then try the command again.
If I remove the validation on pubProfilePath it works. [Parameter(Position=2,ValueFromPipelineByPropertyName=$true)] [ValidateNotNull()] [ValidateScript({Test-Path $_})] [System.IO.FileInfo]$pubProfilePath
Go ahead and remove it.
Right now the script fails when the publishProperties is populated but the pubProfile path is not provided. pubProfilePath should be optional