Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Erring running UpdatePSData.bat - Method invocation failed because does not contain a method 'Where'

Hello,
I followed the instruction by using PortfolioSlicer V3.1.0. I'm using the latest version of powershell and also updated the psConfig.txt
After executing the UpdatePSData.bat file it is throwing an error message. May I know if I'm doing something incorrect?

00:13:02 Script: ExtractExcelData . Duration: 0 sec.
00:13:03 Script: CalcCostBasis . Duration: 0 sec.
Symbol 'TSLA' in Quotes.csv but not in Symbol.csv
Method invocation failed because [Selected.System.Management.Automation.PSCustomObject] does not contain a method
named 'Where'.
At C:\Users\xyz\OneDrive\PortfolioSlicer\PSDataExtract\Scripts\psCheckFiles.ps1:309 char:8
+ if($accountList.Where({$_.Account -eq $s.Account}).count -eq 0) {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Where:String) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound

00:13:03 Script: CheckFiles . Duration: 1 sec.
***** Generated PS files were checked - errors were found, please review *****
Waiting 10sec before closing [Y]?

Thank you very much.

Comments

  • It appears to me that in Quotes.csv file you have quotes for symbol TSLA, but you do not have that symbol defined in Symbol table. If symbol TSLA is not used, please delete all related files from Quotes subfolder and then re-run the scripts.
  • Hello Vidas,
    Thank you very much for taking your time and responding back so quickly.
    I added the TSLA to the symbol table. But I'm still receiving the same error message. At the end I do see it says PS files were checked and found no issues.

    C:\Users\xyz\OneDrive\PortfolioSlicer\PSDataExtract>echo off
    02:10:01 Script: Yahoo Historical . Quotes Requested/Succeed/Failed/Rows: 1/1/0/0. Duration: 21 sec.
    02:10:23 Script: Yahoo Intraday . Quotes Requested/Succeed/Failed/Rows: 1/1/0/1. Duration: 2 sec.
    02:10:26 Script: ExchRate ECB . CurrExch Requested/Succeed/Failed/Rows: 2/2/0/0. Duration: 3 sec.
    02:10:29 Script: ExchRate YahooID . CurrExch Requested/Succeed/Failed/Used: 0/2/0/2. Date: 2023-04-21 . Duration: 6 sec.
    02:10:35 Script: Archive Quotes . Archived rec count: 0. Duration:
    02:10:36 Script: MakeAllFiles Finished creating all data files. Duration: 0 sec.
    02:10:37 Script: Create Dates . Dates: 3034. Duration: 0 sec.
    02:10:37 Script: Append GenQ . GenQuotes SymbolCount/RecCount: 0/0. Duration: 0 sec.
    02:10:37 Script: ExtractExcelData . Duration: 1 sec.
    02:10:38 Script: CalcCostBasis . Duration: 0 sec.
    Method invocation failed because [Selected.System.Management.Automation.PSCustomObject] does not contain a method
    named 'Where'.
    At C:\Users\xyz\OneDrive\PortfolioSlicer\PSDataExtract\Scripts\psCheckFiles.ps1:309 char:8
    + if($accountList.Where({$_.Account -eq $s.Account}).count -eq 0) {
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (Where:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

    02:10:39 Script: CheckFiles . Duration: 1 sec.
    ***** Generated PS files were checked - no issues found *****
    Waiting 10sec before closing [Y]?

    Thank you.
  • Can you please confirm if you have just a single account in your setup? If so, could you please add one more account record (dummy) and try to re-run scripts?
  • Hello Vidas,
    After adding the accounts and ensuring the same exist in the Transaction tab of Source spreadsheet. It worked perfectly. Thank you so much for your help.

    Now, I'm excited to explore this report.

    Thank you!
Sign In or Register to comment.