We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68c8aff commit 972ca56Copy full SHA for 972ca56
1 file changed
samples/manage/azure-sql-db-managed-instance/attach-vpn-gateway/attachVPNGateway.ps1
@@ -8,6 +8,20 @@ $force = $parameters['force']
8
9
$scriptUrlBase = $args[1]
10
11
+function VerifyPSVersion
12
+{
13
+ Write-Host "Verifying PowerShell version, must be 5.0 or higher."
14
+ if($PSVersionTable.PSVersion.Major -ge 5)
15
+ {
16
+ Write-Host "PowerShell version verified." -ForegroundColor Green
17
+ }
18
+ else
19
20
+ Write-Host "You need to install PowerShell version 5.0 or heigher." -ForegroundColor Red
21
+ Break;
22
23
+}
24
+
25
function Ensure-Login ()
26
{
27
$context = Get-AzureRmContext
@@ -156,6 +170,7 @@ function CalculateVpnClientAddressPoolPrefix
156
170
157
171
}
158
172
173
+VerifyPSVersion
159
174
Ensure-Login
160
175
Select-SubscriptionId -subscriptionId $subscriptionId
161
176
0 commit comments