Skip to content

Commit f3b4791

Browse files
committed
Replace ValidateScript scriptblock with private function call
1 parent 48a31ad commit f3b4791

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

ServiceNow/Public/Set-ServiceNowAuth.ps1

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,9 @@ function Set-ServiceNowAuth {
2121
[CmdletBinding()]
2222
Param (
2323
[Parameter(Mandatory = $true)]
24-
[ValidateNotNullOrEmpty()]
25-
[ValidateScript( {
26-
if ($_ -match '^\w+\..*\.\w+') {
27-
$true
28-
}
29-
else {
30-
Throw "The expected URL format is tenant.domain.com"
31-
}
32-
})]
33-
[string]
34-
$Url,
24+
[ValidateScript({Test-ServiceNowURL -Url $_})]
25+
[Alias('ServiceNowUrl')]
26+
[string]$Url,
3527

3628
[Parameter(Mandatory = $true)]
3729
[ValidateNotNullOrEmpty()]

0 commit comments

Comments
 (0)