Update-LiteDBDocument is failing
cadayton opened this issue · comments
Craig Dayton commented
Using the example presented in the README and other testing code (https://cadayton.keybase.pub/PSGallery/Scripts/psConsole.html), the Update-LiteDBDocument command is consistently failing with the same error message.
PS>Get-Service BITS |
>> Select @{Name="_id";E={$_.Name}},DisplayName,Status,StartType |
>> ConvertTo-LiteDbBSON |
>> Update-LiteDBDocument -Collection SvcCollection
Update-LiteDBDocument:
Line |
4 | Update-LiteDBDocument -Collection SvcCollection
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
Kiran Reddy commented
you are right, it does fail. Will check.
for now please use the workaround:
$docs = Get-Service BITS |
select @{Name = "_id"; E = { $_.Name } }, DisplayName, Status, StartType |
ConvertTo-LiteDbBSON
$docs | Update-LiteDBDocument -Collection test
Craig Dayton commented
Thanks!! The workaround work for me.