File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ Function Test-ServiceNowURL {
2+ <#
3+ . SYNOPSIS
4+ For use in testing ServiceNow Urls.
5+
6+ . DESCRIPTION
7+ For use in testing ServiceNow Urls. The test is a simple regex match in an attempt to validate that users use a 'tenant.domain.com' pattern.
8+
9+ . EXAMPLE
10+ Test-ServiceNowURL -Url tenant.domain.com
11+
12+ This example can have text
13+
14+ . OUTPUTS
15+ System.Boolean
16+
17+ #>
18+
19+ [OutputType ([System.Boolean ])]
20+ [CmdletBinding ()]
21+ param (
22+ # Pipeline variable
23+ [Parameter (Mandatory = $true )]
24+ [ValidateNotNullOrEmpty ()]
25+ [string ]$Url
26+ )
27+
28+ begin {}
29+ process {
30+ Write-Verbose " Testing url: $Url "
31+ if ($Url -match ' ^\w+\..*\.\w+' ) {
32+ $true
33+ }
34+ else {
35+ Throw " The expected URL format is tenant.domain.com"
36+ }
37+ }
38+ end {}
39+ }
You can’t perform that action at this time.
0 commit comments