Hello.
I'm trying to use Dynamics SDK via Powershell, I tried to work with WebResources:
Here is my script:
<code>
$webResourcePat = "C:\Test\___default.html" $wr = New-Object -TypeName Microsoft.Xrm.Sdk.Entity -ArgumentList "webresource" $wr["name"] = $webResourceName; $wr["displayname"] = $webResourceName; $web_res_FileContent_Text = [IO.File]::ReadAllText("C:\Test\___default.html") $web_res_FileContent_bytes = [System.Text.Encoding]::Unicode.GetBytes($web_res_FileContent_Text) $base64_web_res_content = [Convert]::ToBase64String($web_res_FileContent_bytes) $wr["content"] = $base64_web_res_content if (("C:\Test\___default.html").Contains(".htm")) { $wr["webresourcetype"] = New-Object -TypeName Microsoft.Xrm.Sdk.OptionSetValue -ArgumentList 1; } try { $id = $service.Create($wr); // !!!!!!!!!!!!!!! ERROR : Cannot find an overload for "Create" and the argument count: "1" $publishXmlRequest += [string]::Concat("<webresource>", $id, "</webresource>"); Write-Host "Done!" -ForegroundColor Green -NoNewline; $publish = $true; } catch [Exception] { Write-Host "Failed! [Error : $_.Exception]" -ForegroundColor Red; continue; }
</code>
I Have error:
Cannot find an overload for "Create" and the argument count: "1".
How can I fix if ?
Thank you
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156