title: Cannot find an overload for "Execute" and the argument count: "1". unable to insert into azure storage table
body: <p>I have a powershell script to upload data into azure storage table. Powershell script looks like this:</p>
  
  <pre><code>
  $StorageAccountName = "xxx" 
  $StorageAccountKey = "xxxxx"
  $ctx = New-AzStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
  $tableName = "ProvisioningRecord"
  $table = Get-AzStorageTable –Name $tableName -Context $ctx
  
  Add-Entity -table $table -partitionKey abc -rowKey xyz
  
  
  function Add-Entity { 
     [CmdletBinding()] 
  
     param( 
        $table, 
        [String]$partitionKey, 
        [String]$rowKey 
  
     )  
  
  
     $entity = New-Object -TypeName "Microsoft.WindowsAzure.Storage.Table.DynamicTableEntity" -ArgumentList $partitionKey, $rowKey 
  
     $result = $table.CloudTable.Execute([Microsoft.WindowsAzure.Storage.Table.TableOperation]::Insert($entity)) 
  
  }
  
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>Cannot find an overload for "Execute" and the argument count: "1".
  At line:1 char:1
  + $result = $table.CloudTable.Execute([Microsoft.WindowsAzure.Storage.T ...
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [], MethodException
      + FullyQualifiedErrorId : MethodCountCouldNotFindBest
  </code></pre>
  
  <p>Following this link: <a href="https://www.catapultsystems.com/blogs/azure-storage-powershell-error-cannot-find-an-overload/" rel="nofollow noreferrer">https://www.catapultsystems.com/blogs/azure-storage-powershell-error-cannot-find-an-overload/</a> i added</p>
  
  <pre><code>$assemblySN = $table.CloudTable.GetType().Assembly.FullName
  $entity = New-Object -TypeName "Microsoft.WindowsAzure.Storage.Table.DynamicTableEntity,$assemblySN" -ArgumentList $partitionKey, $rowKey
  $result = $table.CloudTable.Execute((invoke-expression "[Microsoft.WindowsAzure.Storage.Table.TableOperation,$assemblySN]::InsertOrReplace(`$entity)"))
  </code></pre>
  
  <p>It gives me an error:</p>
  
  <pre><code>New-Object : Cannot find type [Microsoft.WindowsAzure.Storage.Table.DynamicTableEntity,Microsoft.Azure.Cosmos.Table, Version=0.10.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]: 
  verify that the assembly containing this type is loaded.
  At line:1 char:11
  + $entity = New-Object -TypeName "Microsoft.WindowsAzure.Storage.Table. ...
  +           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException
      + FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand
  </code></pre>
  
  <p>But the same code with the above modifications(adding $assemblySN) works in Powershell version 5.1.17134.590. Same script does't work in Powershell version 5.1.17763.316.</p>
  
  <p>Can anybody help me with this?</p>