Howdy, Stranger!

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

Red errors when launching UpdatePSData

Hi All,

I have followed the instructions unfortunately I get many red errors and no error file being generated for troubleshooting,
Can someone point out what I'm doing wrong?

Here's a snapshot of what the command prompt is giving me:
At C:\Users\Charles\Google Drive\PortfolioSlicer\Scripts\GetQuotesYahoo.ps1:12
char:60
+ $minDate = ($config | Select-Object -Index(($config.IndexOf <<<< ("<MinDate>"
))+1)).Replace("","");
    + CategoryInfo          : InvalidOperation: (IndexOf:String) [], RuntimeEx
   ception
    + FullyQualifiedErrorId : MethodNotFound

*** Error. Min date in psconfig file is  but should be between 1960-01-01 and 2
050-01-01
Method invocation failed because [System.Object[]] doesn't contain a method nam
ed 'IndexOf'.
At C:\Users\Charles\Google Drive\PortfolioSlicer\Scripts\GetQuotesGoogle.ps1:11
 char:72
+ $verbose = $false; if (($config | Select-Object -Index(($config.IndexOf <<<<
("<DetailOutput>"))+1)).Replace("","").ToLower() -eq "yes") {$ve
rbose=$true;};  # Check if configured to do detail output
    + CategoryInfo          : InvalidOperation: (IndexOf:String) [], RuntimeEx
   ception
    + FullyQualifiedErrorId : MethodNotFound
Thanks in advance,
Charles

Edit:
- I have created a PSData folder and indicated its position in the psConfig.txt file (C:\Users\Charles\Google Drive\PortfolioSlicer\PSData}
- "Get-ExecutionPolicy" reports Unrestricted

Comments

  • Ok, so I managed to solve the issue described above by upgrading to Windows Management Framework 3.0 : https://www.microsoft.com/en-us/download/details.aspx?id=34595 as indicated by user tkdennis

    Unfortunately I still get some errors when running the script and only "CurrencyConv", "Dividens" and "Quotes" are being generated.

    Here's what I get in command prompt:
    C:\Users\Charles\Google Drive\PortfolioSlicer>echo off
    00:40:03 Script: Yahoo Historical . Quotes Requested/Succeed/Failed: 12/0/12.
    Duration: 1 sec.
    00:40:05 Script: Exchange Rates BoC . Quotes Requested/Succeed/Failed: 2/0/2. N
    ew records: 0. Duration: 1 sec.
    00:40:06 Script: Yahoo Dividends . Quotes Requested/Succeed/Failed/Rows: 8/8
    /0/0. Duration: 0 sec.
    00:40:08 Script: Yahoo Intraday . Quotes Requested/Received/Used : 12/12/12
    . Duration: 1 sec.
    Last Quote time: 2016-08-24 4:38pm
    00:40:09 Script: Yahoo Currency . Quotes received: 2. Last Quote: 2016-08-2
    5 0:40am. Duration: 1 sec.

    .\Scripts\ArchiveOldQuotes.ps1 : The term '.\Scripts\ArchiveOldQuotes.ps1' is
    not recognized as the name of a cmdlet, function, script file, or operable
    program. Check the spelling of the name, or if a path was included, verify
    that the path is correct and try again.
    At line:1 char:1
    + .\Scripts\ArchiveOldQuotes.ps1
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (.\Scripts\ArchiveOldQuotes.ps1:
    String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    .\Scripts\CreateDatesFile.ps1 : The term '.\Scripts\CreateDatesFile.ps1' is
    not recognized as the name of a cmdlet, function, script file, or operable
    program. Check the spelling of the name, or if a path was included, verify
    that the path is correct and try again.
    At line:1 char:1
    + .\Scripts\CreateDatesFile.ps1
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (.\Scripts\CreateDatesFile.ps1:S
    tring) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    .\Scripts\AppendGeneratedQuotes.ps1 : The term
    '.\Scripts\AppendGeneratedQuotes.ps1' is not recognized as the name of a
    cmdlet, function, script file, or operable program. Check the spelling of the
    name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + .\Scripts\AppendGeneratedQuotes.ps1
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (.\Scripts\AppendGeneratedQuotes
    .ps1:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    .\Scripts\CheckPSFiles.ps1 : The term '.\Scripts\CheckPSFiles.ps1' is not
    recognized as the name of a cmdlet, function, script file, or operable
    program. Check the spelling of the name, or if a path was included, verify
    that the path is correct and try again.
    At line:1 char:1
    + .\Scripts\CheckPSFiles.ps1
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (.\Scripts\CheckPSFiles.ps1:Stri
    ng) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    Waiting 10sec before closing [Y]?
  • Hi,

    It looks that you put scripts into folder
    C:\Users\Charles\Google Drive\PortfolioSlicer

    Error message says that during execution file
    .\Scripts\ArchiveOldQuotes.ps1
    Can you please confirm if that file is there.
  • Hi Vidas,

    I made the mistake to download the wrong script set which didn't contain all the required files.

    Everything seems to be working as it should now, however I do have two questions:

    - My stock prices are pulled from yahoo in cents (GBP) and copied accordingly to in the main excel file (srcSymbol). How can all the values then be converted back to British pounds?

    - Which field should be used to take stamp duty into account on any purchase?

    Thank you very much for making this freely available!

    Charles
  • Check psConfig.txt file <yahoo> strings. There for each symbol you can specify factor, example 0.01 to convert to pounds.
    I do not know what is stamp duty, maybe fee for purchase?
  • Assuming it's FactorHistory, is this the correct syntax?

    HSTN.L,MinDate,MaxDate,IntraDayFlag[Y|N],[DividendFlag[Y|N],0.01,FactorIntraDay,FactorDividend

    Stamp duty is a UK tax of 0.5% on orders over 1,000£, can a percentage be entered in the fee for purchase?
  • Yes, calc amount yourself and add to fee
Sign In or Register to comment.