Functions/Get-DiscoveryStreams.ps1

<#
.SYNOPSIS
Retrieves the list of uploaded discovery streams for Microsoft Defender for Cloud Apps.
 
.DESCRIPTION
The Get-DiscoveryStreams function retrieves the list of uploaded discovery streams for Microsoft Defender for Cloud Apps using the Microsoft Graph API.
 
.PARAMETER None
This function does not accept any parameters.
 
.EXAMPLE
PS C:\> Get-DiscoveryStreams
Returns the list of uploaded discovery streams for Microsoft Defender for Cloud Apps.
 
.NOTES
For more information about Microsoft Defender for Cloud Apps, see https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/microsoft-defender-for-cloud-apps?view=o365-worldwide.
#>

function Get-DiscoveryStreams {
    [CmdletBinding()]
    param ()

    Begin {
        $ErrorActionPreference = 'Stop'
        $resourceGraph = "https://graph.microsoft.com"
        $discoveryStreamsEndpoint = "$resourceGraph/beta/security/dataDiscovery/cloudAppDiscovery/uploadedStreams"
    }
    Process {                  
                    $response = Invoke-GraphAPI -Uri $discoveryStreamsEndpoint -Method Get
                    return $response.value   
    }
}