Functions/Get-MCASAppId.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<#
.Synopsis
   Returns an application's id (integer) given its name.
.DESCRIPTION
   Get-MCASAppId gets the unique identifier integer value that represents an app in MCAS.
 
.EXAMPLE
    PS C:\> Get-MCASAppId -AppName Microsoft_Cloud_App_Security
    20595
 
.FUNCTIONALITY
   Get-MCASAppId is intended to return the id of an app when the app name is provided as input.
#>

function Get-MCASAppId {
    [CmdletBinding()]
    param
    (
        # Specifies the app for which to retrieve the integer id value.
        [Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=0)]
        [ValidateNotNullOrEmpty()]
        [mcas_app]$AppName
    )
    process
    {
        $AppName -as [int]
    }
}