Skip to content

Commit 480a70c

Browse files
author
Dick Tracy
committed
added root path
1 parent 67174c4 commit 480a70c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Archived

Lines changed: 0 additions & 1 deletion
This file was deleted.

Step 3B-1. Build Azure Advanced S2S - Region 1.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,8 @@ run show ipsec vpn sa
722722

723723
#Always output script
724724
$ScriptName = $LogfileName.replace('.log','.script')
725-
Remove-Item "$PSScriptRoot\Logs\$ScriptName" -Force -ErrorAction SilentlyContinue | Out-Null
726-
$VyOSFinal | Add-Content "$PSScriptRoot\Logs\$ScriptName"
725+
Remove-Item "$ResourcePath\Logs\$ScriptName" -Force -ErrorAction SilentlyContinue | Out-Null
726+
$VyOSFinal | Add-Content "$ResourcePath\Logs\$ScriptName"
727727
$VyOSConfig['ResetVPNConfigs'] = $False
728728

729729
If($RouterAutomationMode)
@@ -859,7 +859,7 @@ If($RunManualSteps){
859859
Write-Host "`nOpen ssh session for $($VyOSConfig.VMName) by running command [" -ForegroundColor White -NoNewline
860860
Write-Host ("ssh vyos@{0}" -f $VyOSExternalIP) -ForegroundColor Yellow -NoNewline
861861
Write-Host "]" -ForegroundColor White
862-
Write-Host "Then copy the script between the lines or `n from $PSScriptRoot\Logs\$ScriptName" -ForegroundColor White
862+
Write-Host "Then copy the script between the lines or `n from $ResourcePath\Logs\$ScriptName" -ForegroundColor White
863863
Write-Host "`nA reboot may be required on $($VyOSConfig.VMName) for updates to take effect" -ForegroundColor Red
864864
Write-Host "In router's ssh session, run command [" -ForegroundColor Gray -NoNewline
865865
Write-Host "reboot now" -ForegroundColor Yellow -NoNewline

Step 3B-2. Build Azure Advanced S2S - Region 2.ps1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ param(
6262
$ErrorActionPreference = "Stop"
6363
#Requires -Modules Az.Accounts,Az.Resources,Az.Network
6464
Set-Item Env:\SuppressAzurePowerShellBreakingChangeWarnings "true" | Out-Null
65+
[string]$ResourcePath = ($PWD.ProviderPath, $PSScriptRoot)[[bool]$PSScriptRoot]
6566

6667
#region Grab Configurations
6768
If($PSScriptRoot.ToString().length -eq 0)
@@ -71,14 +72,14 @@ If($PSScriptRoot.ToString().length -eq 0)
7172
Break
7273
}
7374
Else{
74-
Write-Host ("Loading {0}..." -f "$PSScriptRoot\$ConfigurationFile") -ForegroundColor Yellow -NoNewline
75-
. "$PSScriptRoot\$ConfigurationFile" -NoVyosISOCheck
75+
Write-Host ("Loading {0}..." -f "$ResourcePath\$ConfigurationFile") -ForegroundColor Yellow -NoNewline
76+
. "$ResourcePath\$ConfigurationFile" -NoVyosISOCheck
7677
}
7778
#endregion
7879

7980
#region start transcript
8081
$LogfileName = "$RegionBName-AdvSetup-$(Get-Date -Format 'yyyy-MM-dd_Thh-mm-ss-tt').log"
81-
Try{Start-transcript "$PSScriptRoot\Logs\$LogfileName" -ErrorAction Stop}catch{Start-Transcript "$PSScriptRoot\$LogfileName"}
82+
Try{Start-transcript "$ResourcePath\Logs\$LogfileName" -ErrorAction Stop}catch{Start-Transcript "$ResourcePath\$LogfileName"}
8283
#endregion
8384

8485
#Make it a global variable so it used for the entire session
@@ -667,8 +668,8 @@ run show ipsec vpn sa
667668

668669
#Always output script
669670
$ScriptName = $LogfileName.replace('.log','.script')
670-
Remove-Item "$PSScriptRoot\Logs\$ScriptName" -Force -ErrorAction SilentlyContinue | Out-Null
671-
$VyOSFinal | Add-Content "$PSScriptRoot\Logs\$ScriptName"
671+
Remove-Item "$ResourcePath\Logs\$ScriptName" -Force -ErrorAction SilentlyContinue | Out-Null
672+
$VyOSFinal | Add-Content "$ResourcePath\Logs\$ScriptName"
672673
$VyOSConfig['ResetVPNConfigs'] = $False
673674

674675
If($RouterAutomationMode)
@@ -803,7 +804,7 @@ If($RunManualSteps){
803804
Write-Host "`nOpen ssh session for $($VyOSConfig.VMName) by running command [" -ForegroundColor White -NoNewline
804805
Write-Host ("ssh vyos@{0}" -f $VyOSExternalIP) -ForegroundColor Yellow -NoNewline
805806
Write-Host "]" -ForegroundColor White
806-
Write-Host "Then copy the script between the lines or `n from $PSScriptRoot\Logs\$ScriptName" -ForegroundColor White
807+
Write-Host "Then copy the script between the lines or `n from $ResourcePath\Logs\$ScriptName" -ForegroundColor White
807808
Write-Host "`nA reboot may be required on $($VyOSConfig.VMName) for updates to take effect" -ForegroundColor Red
808809
Write-Host "In router's ssh session, run command [" -ForegroundColor Gray -NoNewline
809810
Write-Host "reboot now" -ForegroundColor Yellow -NoNewline

0 commit comments

Comments
 (0)