none
Cannot delete data source - BSDS (v7) - PowerShell RRS feed

  • Question

  • I can't delete a data source. Any suggestions? 

     

    function Execute-HTTPDeleteCommand()

     

     {

     

    param(

     

    [string]$target = $null

     

    )

     

     

    $webRequest = [System.Net.HttpWebRequest]::Create($target)

     

    $webRequest.Method = "DELETE"

     

    $requestStream = $webRequest.GetRequestStream()

     

    $requestStream.Close()

     

     

        [System.Net.HttpWebResponse]$resp = $webRequest.GetResponse();

     

        Write-Host  $rs.StatusCode

     

        $rs = $resp.GetResponseStream();

     

        [System.IO.StreamReader]$sr = New-Object System.IO.StreamReader -argumentList $rs;

     

        [string]$results = $sr.ReadToEnd();

     

        return $results;

     

     }

     

     function Execute-HTTPGetCommand()

     

     {

     

    param(

     

    [string]$target = $null

     

    )

     

     

    $webRequest = [System.Net.WebRequest]::Create($target)

     

    $webRequest.Method = "GET"

     

    #$requestStream = $webRequest.GetRequestStream()

     

    #$requestStream.Close()

     

     

        [System.Net.HttpWebResponse]$resp = $webRequest.GetResponse();

     

        $rs = $resp.GetResponseStream();

     

        Write-Host  $rs.StatusCode

     

        [System.IO.StreamReader]$sr = New-Object System.IO.StreamReader -argumentList $rs;

     

        [string]$results = $sr.ReadToEnd();

     

        return $results;

     

     }

     

    $res = Execute-HTTPGetCommand "http://spatial.virtualearth.net/REST/v1/data?&key=keyhere";

     

    Write-Host $res

     

    $res = Execute-HTTPDeleteCommand "http://spatial.virtualearth.net/REST/v1/data/accessidhere/entitytypenamehere?key=keyhere"

     

    Write-Host $res

     

    • Moved by Ricky_Brundritt Friday, March 9, 2012 5:18 PM (From:Bing Maps: Map Control and Web services Development)
    Tuesday, April 26, 2011 2:45 PM

Answers