12Knocksinna / Office365itpros

Office 365 for IT Pros PowerShell examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue running script: Exception calling "Add" with "2" argument(s): - At line:51 char:34

QuintenPXS opened this issue · comments

image

Exception calling "Add" with "2" argument(s): "Item has already been added. Key in dictionary: '' Key being added: ''"
At line:51 char:34

  • ... portSkus) { $SkuHashTable.Add([string]$Line.SkuId, [string]$Line.Disp ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : ArgumentException

image

any idea why or is this script no longer working/supported ?

thanks!

I have the same issue but have not yet found the issue at first glance. Let it run through, though. Report is still generated.

An attempt is being made to add a record that already exists in the hash table. It looks horrible but doesn't cause a problem. Some error handling would suppress it.