Skip to content
Open
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions scripts/collectlogs/collectlogs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ md $BaseDir -ErrorAction Ignore
$helper = "$BaseDir\helper.psm1"
if (!(Test-Path $helper))
{
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/$GithubSDNRepository/master/scripts/helper/helper.psm1" -OutFile $BaseDir\helper.psm1
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/helper/helper.psm1" -OutFile $BaseDir\helper.psm1
}
ipmo $helper -Function DownloadFile

DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/master/scripts/helper/dumpVfpPolicies.ps1" -Destination $BaseDir\dumpVfpPolicies.ps1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/master/scripts/helper/hns.v2.psm1" -Destination $BaseDir\hns.v2.psm1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/master/scripts/starthnstrace/starthnstrace.ps1" -Destination $BaseDir\starthnstrace.ps1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/master/scripts/startpacketcapture/startpacketcapture.ps1" -Destination $BaseDir\startpacketcapture.ps1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/master/Kubernetes/scripts/portReservationTest/portReservationTest.ps1" -Destination $BaseDir\portReservationTest.ps1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/helper/dumpVfpPolicies.ps1" -Destination $BaseDir\dumpVfpPolicies.ps1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/HNS/hns.v2.psm1" -Destination $BaseDir\hns.v2.psm1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/starthnstrace/starthnstrace.ps1" -Destination $BaseDir\starthnstrace.ps1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/startpacketcapture/startpacketcapture.ps1" -Destination $BaseDir\startpacketcapture.ps1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/portReservationTest/portReservationTest.ps1" -Destination $BaseDir\portReservationTest.ps1

ipmo $BaseDir\hns.v2.psm1 -Force

Expand Down
27 changes: 27 additions & 0 deletions scripts/collectlogs/downloadScripts.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Param(
[parameter(Mandatory = $false)] [ValidateSet(1,2)] [int] $HnsSchemaVersion = 2
)

$GithubSDNRepository = 'Microsoft/wcnscripts'
if ((Test-Path env:GITHUB_SDN_REPOSITORY) -and ($env:GITHUB_SDN_REPOSITORY -ne ''))
{
$GithubSDNRepository = $env:GITHUB_SDN_REPOSITORY
}

$BaseDir = (Get-Location).Path
mkdir $BaseDir -ErrorAction Ignore

$helper = "$BaseDir\helper.psm1"
if (!(Test-Path $helper))
{
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/helper/helper.psm1" -OutFile $BaseDir\helper.psm1
}
Import-Module $helper -Function DownloadFile

DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/collectlogs/collectlogs.ps1" -Destination $BaseDir\collectlogs.ps1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/helper/dumpVfpPolicies.ps1" -Destination $BaseDir\dumpVfpPolicies.ps1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/master/scripts/helper/VFP.psm1" -Destination $BaseDir\VFP.psm1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/HNS/hns.v2.psm1" -Destination $BaseDir\hns.v2.psm1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/starthnstrace/starthnstrace.ps1" -Destination $BaseDir\starthnstrace.ps1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/startpacketcapture/startpacketcapture.ps1" -Destination $BaseDir\startpacketcapture.ps1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/portReservationTest/portReservationTest.ps1" -Destination $BaseDir\portReservationTest.ps1
4 changes: 2 additions & 2 deletions scripts/helper/dumpVfpPolicies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ md $BaseDir -ErrorAction Ignore
$helper = "$BaseDir\helper.psm1"
if (!(Test-Path $helper))
{
Start-BitsTransfer "https://raw.githubusercontent.com/$GithubSDNRepository/master/scripts/helper/helper.psm1" -Destination $BaseDir\helper.psm1
Start-BitsTransfer "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/helper/helper.psm1" -Destination $BaseDir\helper.psm1
}
ipmo $helper

DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/master/scripts/helper/VFP.psm1" -Destination $BaseDir\VFP.psm1
DownloadFile -Url "https://raw.githubusercontent.com/$GithubSDNRepository/main/scripts/helper/VFP.psm1" -Destination $BaseDir\VFP.psm1
ipmo $BaseDir\VFP.psm1

$ports = Get-VfpPorts -SwitchName $switchName
Expand Down
2 changes: 1 addition & 1 deletion scripts/starthnstrace/starthnstrace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ if (-NOT $NoPrompt.IsPresent)
# try to download collectlogs.ps1
try
{
$isCLFnd = Get-WebFile -URI 'https://raw.githubusercontent.com/microsoft/wcnscripts/master/scripts/collectlogs/collectlogs.ps1' -savePath "$BaseDir" -fileName 'collectlogs.ps1'
$isCLFnd = Get-WebFile -URI 'https://raw.githubusercontent.com/microsoft/wcnscripts/main/scripts/collectlogs/collectlogs.ps1' -savePath "$BaseDir" -fileName 'collectlogs.ps1'
}
catch
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/startpacketcapture/startpacketcapture.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ if (-NOT $NoPrompt.IsPresent)
# try to download collectlogs.ps1
try
{
$isCLFnd = Get-WebFile -URI 'https://raw.githubusercontent.com/microsoft/wcnscripts/master/scripts/collectlogs/collectlogs.ps1' -savePath "$BaseDir" -fileName 'collectlogs.ps1'
$isCLFnd = Get-WebFile -URI 'https://raw.githubusercontent.com/microsoft/wcnscripts/main/scripts/collectlogs/collectlogs.ps1' -savePath "$BaseDir" -fileName 'collectlogs.ps1'
}
catch
{
Expand Down