Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Functions/Invoke-MCASRestMethod.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function Invoke-MCASRestMethod {
[CmdletBinding()]
param (
# Specifies the credential object containing tenant as username (e.g. 'contoso.us.portal.cloudappsecurity.com') and the 64-character hexadecimal Oauth token as the password.
# Specifies the credential object containing tenant as username (e.g. 'contoso.us.portal.cloudappsecurity.com' for Commercial) and the 64-character hexadecimal Oauth token as the password.
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[ValidateScript( {
($_.GetNetworkCredential().username).EndsWith('.portal.cloudappsecurity.com')
($_.GetNetworkCredential().username).EndsWith('.portal.cloudappsecurity.com') -or ($_.GetNetworkCredential().username).EndsWith('.portal.cloudappsecurity.us')
})]
[ValidateScript( {
$_.GetNetworkCredential().Password -match ($MCAS_TOKEN_VALIDATION_PATTERN)
Expand Down Expand Up @@ -181,4 +181,4 @@
#Write-Information $recordTotal
}
$response
}
}