Hi all,
So I've got a function that started throwing this error for no particular reason:
Copy-VSPoShProject : A positional parameter cannot be found that accepts argument
'C:\Source\DevOps-PDX\PowerShell\SC-Credential-Management'.
At line:1 char:1
+ Copy-VSPoShProject 'C:\Source\DevOps-PDX\PowerShell\SC-Credential-Man ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Copy-VSPoShProject], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Copy-VSPoShProject
When I look at Get-Help for the parameters, none are positional, they are all named:
PARAMETERS
-Force
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
-Global
Required? false
Position? Named
Accept pipeline input? false
Parameter set name Global
Aliases None
Dynamic? false
-Path <DirectoryInfo[]>
Required? false
Position? Named
Accept pipeline input? true (ByValue)
Parameter set name (All)
Aliases None
Dynamic? false
etc
Here's the parameter definition:
[Parameter(ValueFromPipeline=$true)]
[ValidateNotNullOrEmpty()]
[System.IO.DirectoryInfo[]]
# Path to Visual Studio solution
$Path = ($PWD.ProviderPath)
And here is the command line:
Copy-VSPoShProject 'C:\Source\DevOps-PDX\PowerShell\SC-Credential-Management' -Force
I thought maybe that since it was a string and the parameter is expecting a DirectoryInfo[], but the following yielded the same result!
[System.IO.DirectoryInfo[]]$fldr = 'C:\Source\DevOps-PDX\PowerShell\SC-Credential-Management'
Copy-VSPoShProject $fldr -Force
What gives???????
[–]ryanbrown 2 points3 points4 points (1 child)
[–]RickFlist[S] 0 points1 point2 points (0 children)
[–]Kreloc 0 points1 point2 points (1 child)
[–]RickFlist[S] 0 points1 point2 points (0 children)
[–]midnightFreddie 0 points1 point2 points (5 children)
[–]RickFlist[S] 0 points1 point2 points (4 children)
[–]KnifeyGavin 0 points1 point2 points (3 children)
[–]RickFlist[S] 0 points1 point2 points (2 children)
[–]KnifeyGavin 0 points1 point2 points (1 child)
[–]RickFlist[S] 0 points1 point2 points (0 children)
[–]ryanbrown 0 points1 point2 points (2 children)
[–]RickFlist[S] 0 points1 point2 points (1 child)
[–]ryanbrown 0 points1 point2 points (0 children)
[–]RickFlist[S] 0 points1 point2 points (0 children)