$storageAccount = "*******" $tableName = "InstalledApplications" $sasWriteToken = "********" # should be headers, because you use headers in Invoke-RestMethod $headers = @{ Accept = 'application/json;odata=nometadata' } $pcname = $env:computername $array = Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate,$customproperty1,$customproperty4 -unique # RestAPI call begins foreach ($apps in $array){ $computername = $apps.ComputerName $appDisplayname = $apps.DisplayName $resource = "$tableName(PartitionKey='$computername',RowKey='$appDisplayname')" $tableUri = "https://$storageAccount.table.core.windows.net/$resource$sasWriteToken" $hash = @{ PartitionKey = $computername RowKey = $appDisplayname AppDisplayversion = $apps.DisplayVersion AppPublisher = $apps.Publisher AppInstallDate = $apps.InstallDate Location = $apps.Location Signature = $apps.SignatureKind } $body = $hash| ConvertTo-Json Invoke-RestMethod -Method PUT -Uri $tableUri -Headers $headers -Body $body -ContentType application/json }